Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file Document.ml
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556(* This file is free software. See file "license" for more details. *)(** {1 Simple Formatted Document} *)moduleFmt=Formattypeblock=[`Sofstring(* section *)|`Pofstring(* paragraph *)|`Preofstring(* formatted paragraph *)|`Iofstring*t(* indented doc with header *)|`Loftlist(* list of items *)|`Tblofstringlist*tlistlist(* table *)]andt=blocklistletksprintf~ffmt=letbuf=Buffer.create32inletout=Format.formatter_of_bufferbufinFormat.kfprintf(fun_->Format.pp_print_flushout();f(Buffer.contentsbuf))outfmtletsections=`Ssletparagraphs=`Psletparagraph_fs=ksprintf~f:paragraphsletindentij=`I(i,j)letpres=`Presletpre_fs=ksprintf~f:presletlistl=`Llletpp_list_p=Format.pp_print_list~pp_sep:(funout()->Format.pp_print_cutout())pletrecppout(l:t)=Fmt.fprintfout"@[<v>%a@]"(pp_list_pp_block)landpp_blockout:block->unit=function|`Ssec->Fmt.fprintfout"# @[<h>%s@]@,"sec|`Pmsg->Fmt.fprintfout"@[%a@]"Format.pp_print_textmsg|`Premsg->Fmt.fprintfout"%s"msg|`I(head,body)->Fmt.fprintfout"@[<v2>%s::@ %a@]"headppbody|`Ll->letpp_itemoutx=Fmt.fprintfout"@[<2>- %a@]"ppxinFmt.fprintfout"@[<v>%a@]"(pp_list_pp_item)l|`Tbl(heads,rows)->letli=String.make60'-'inletpp_liout()=Format.pp_print_stringoutliinletpp_row=pp_list_ppinFormat.fprintfout"@[<v>%a@,%a@,"pp_li()(pp_list_Format.pp_print_string)heads;List.iter(funrow->Format.fprintfout"%a@,%a@,"pp_li()pp_rowrow)rows;Format.fprintfout"%a@]"pp_li()