| Document structure | |||||
| Document head | Sections | Subsections | Units | Subunits | Paragraph elements |
| Title | Package | Module | ML-Function | Named Paragraph | Text Attributes |
| TOC | Program | C-Lib | ML-Type | Interface | Ordered List |
| ML-Value | Example | Unordered List | |||
| ML-Class | Table | ||||
| ML-Module | Name | ||||
| C-Interface | Link | ||||
| Generic S1 | Generic S2 | Generic S3 | Generic S4 | Special Interfaces | |
| Intro | Intro | Intro | Intro | Intro | |
.OL
.LI Line 1 .IL
.LI Line 2 .IL
.LI ... .IL
.LO
|
| MlDoC dot commands |
| Section headers | MlDoC dot commands |
| Available sections | |||
| Name | begin | end | Comment |
| Package | .PK | .KP | Name argument required |
| Program | .PR | .RP | Name argument required |
| Generic Section S1 | .S1 | .1S | Name argument required |
| Example |
.PK
.NA Standard Library .AN
...
.KP
|
| Subsection headers | MlDoC dot commands |
| Available subsections | |||
| Name | begin | end | Comment |
| ML-Module | .MD | .DM | Name argument required |
| C-Library | .CY | .YC | Name argument required |
| Generic Subsection S2 | .S2 | .2S | Name argument required |
| Unit headers | MlDoC dot commands |
| Available units | |||
| Name | begin | end | Comment |
| ML-Function | .FU | .UF | Name argument required |
| ML-Type | .TP | .PT | Name argument required |
| ML-Value | .MV | .VM | Name argument required |
| ML-Class | .CL | .LC | Name argument required |
| ML-Module | .MD | .DM | Name argument required |
| C-Interface | .CI | .IC | Name argument required |
| Generic Unit S3 | .S3 | .3S | Name argument required |
| Subunits | MlDoC dot commands |
| Available subunits (paragraphs) | |||
| Name | begin | end | Comment |
| Named Paragraph | .PA | .AP | Name argument optional |
| Interface | .IN | .NI | Name argument optional |
| Example | .EX | .XE | Name argument optional |
| Preformatted text | .{ | .} | |
| Generic Subunit S4 | .S4 | .4S | Name argument required |
| Special Interfaces | MlDoC dot commands |
| Available special interfaces | |||
| Name | begin | end | Subarguments (*=optional, #=multiple) |
| ML-Function | .IF | .FI | Name, RetVal (#), Arg (#), Val (*#) |
| ML-Value | .IV | .VI | Name, Arg (#) |
| ML-Type (type list) | .IT | .TI | Name, Arg (#) |
| ML-Structure (type) | .IS | .SI | Name, Arg (*#) |
| ML-Module | .IM | .MI | Name, other specials |
| ML-Class | .CS | .SC | Name, Arg [*#], Obj |
| ML-Class method | .MT | .TM | Name, Arg |
| C-Header | .CH | .HC | |
| C-Function | .CF | .FC | Name, Arg (#) , RetVal |
| C-Variable | .CV | .VC | Name, Arg |
| Available subarguments | |||
| Name | Description | begin | end |
| Name | Name of function,... | .NA | .AN |
| Comment | Placed before the special interface | .(* | .*) |
| RetVal | Return value of a function (uncurried subvalue) | .RV | .VR |
| Arg | Argument of a function (curried value) | .AR | .RA |
| Val | Value argument of a function (uncurried subvalue) | .AV | .VA |
| Obj | Class object | .OB | .BO |
| Programming Interface: Function interfaces | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
|
||||||||||||||||||||||||
|
||||||||||||||||||||||||
|
||||||||||||||||||||||||
|
.IN
.NA Function interfaces .AN
.IF
.NA myfun1 .AN
.RV ret1:int .(* The first return argument .*) .VR
.RV ret2:bool .(* The second one .*) .VR
.AR ~arg1:float .(* The first fun arg .*) .RA
.AR ~arg2:string list .(* The second one .*) .RA
.FI
.IF
.NA myfun2 .AN
.RV ret1:bool .VR
.AV arg1:float .VA
.AV arg2:string list .VA
.FI
.CH
sys/io.h
.HC
.CF
.NA cfun .AN
.RV int .VR
.AR float arg1 .RA
.AR char arg2 .RA
.FC
.IV
.(* The first value interface .*)
.NA myval .AN
.AR ~arg1:string .(* The arg string .*) .RA
.AR ~arg2:int .RA
.AR retarg:float .RA
.VI
.NI
|
| Programming Interface | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
.IN
.IT
.NA mytype .AN
.AR Type_1 .RA
.AR Type_2 .RA
.AR Type_3 .RA
.TI
.IS
.NA mytype .AN
.AR .MU a:int .RA
.AR b:float .RA
.AR c:int list .RA
.SI
.CS
.NA myclass .AN
.AR a:int .RA
.AR b:int .RA
.OB
.IV
.NA .MU speed .AN
.AR dir:int list .RA
.AR vl: int list .RA
.AR ?really: bool .RA
.VI
.IV
.NA align .AN
.AR up:string list .RA
.AR down: int list .RA
.AR ?really: bool .RA
.VI
.MT
.NA .PV up .AN
.AR v:int .RA
.AR name:string .RA
.AR ~arg3:int int list list .RA
.AR () .RA
.TM
.BO
.SC
.IM
.NA mymod .AN
.IT
.NA mytype .AN
.AR Type_1 .RA
.AR Type_2 .RA
.AR Type_3 .RA
.TI
.IV
.NA align .AN
.AR up:string list .RA
.AR down: int list .RA
.AR ?really: bool .RA
.VI
.IV
.NA .MU speed .AN
.AR dir:int list .RA
.AR vl: int list .RA
.AR ?really: bool .RA
.VI
.MI
.NI
|
| Paragraph elements | MlDoC dot commands |
| Lists | |||
| Name | begin | end | Comment |
| Ordered (numbered) List | .OL | .LO | |
| Unordered List | .UL | .LU | |
| Option List | .PL | .LP | First command in List item must be a Name. |
| List item | .LI | .IL | Used inside lists only. |
.PL
.LI
.NA -a .AN
This program option is used to show all available options.
.IL
.LI
.NA -b .AN
This program option is used to build all available options.
.IL
.LP
|
| Tables | |||
| Name | begin | end | Comment |
| Table body | .TB | .BT | |
| NoRulers | .NR | Don't put boxes around the table cells. | |
| Table head | .TH | .HT | Optional table head row. |
| Table row | .TR | .RT | |
| Table columns | .TC | .CT | Must be included between the row command. |
| 1 | 2 |
| 3 | 4 |
.TB
.TR
.TC 1 .CT
.TC 2 .CT
.RT
.TR
.TC 3 .CT
.TC 4 .CT
.RT
.BT
|
| 1 | 2 |
| 3 | 4 |
| Name | begin | end | Description |
| Name | .NA | .AN | Outside from special interfaces, this command emphasize names of functions, types or other important names. |
| Link | .LK | .KL | A link to another section or document |
| Text elements | MlDoC dot commands |
| Name | begin | end | Description |
| Newline | .NL | Flush the current text paragraph and force a newline. | |
| Indentmark | .# | Increase the current text indention. Only used in preformatted paragraphs like examples. | |
| Preformatted text ('as is') | . [ | . ] | Print inlined raw text. Ignore all dot commands. |
| Comments | .(* | .*) | Comments can be placed in Arguments . |
| Text attributes | |
| Attribute | command |
| Boldface style | .B |
| Italic style | .I |
| Boldface and italic style | .BI |
| Typewriter style | .T |
| Romane style (default) | .R |
| Superscript textmode | .SP .PS |
| Subscript textmode | .SB .BS |
| Summary of dot commands | MlDoC dot commands |
| .B | .R | Bold text style |
| .BI | .R | Bold-Italic text style |
| .I | .R | Italic text style |
| .T | .R | Typewriter text style |
| .S | .R | Symbol text style [NA] |
| .SB | .BS | Subscript text mode |
| .SP | .PS | Superscript text mode |
| . [ | . ] | 'As-Is' text mode |
| .NL | Newline: End of paragraph |
| .MU | Special ML-attribute mutable | |
| .PV | Special ML-attribute private | |
| .VT | Special ML-attribute virtual | |
| .NR | No rulers around tables and table cells | |
| .# | White Space in example and As-Is environments | |
| .<< | .>> | Include a MlDoc file at the current position |
| .LK | .KL | A document link |
| .OL | .LO | Numbered (ordered) list body |
| .UL | .LU | Unnumbered (unorderd) list body |
| .PL | .LP | Option (definition) list |
| .LI | .IL | A list item |
| .TB | .BT | Table body |
| .TR | .RT | Table row |
| .TC | .CT | Table column |
| .TH | .HT | Optional table head |
| .IF | .FI | ML-Function Interface |
| .IV | .VI | ML-Value Interface |
| .IT | .TI | ML-Type Interface |
| .IS | .SI | ML-Structure Interface |
| .IX | .XI | ML-Exception Interface |
| .IM | .MI | ML-Module Interface |
| .CH | .HC | C-Header Interface |
| .CF | .FC | C-Function Interface |
| .CV | .VC | C-Variable Interface |
| .CS | .SC | ML-Class Interface |
| .OB | .BO | ML-Object (Class) Interface |
| .MT | .TM | ML-Method (Class) Interface |
| .NA | .AN | Name argument |
| .AR | .RA | Curried value argument |
| .AV | .VA | Uncurried (tuple) value argument |
| .RV | .VR | Return argument of a function |
| .PR | .RP | Program Section |
| .PK | .KP | Package Section |
| .MD | .DM | ML-Module |
| .CY | .YC | C-Library |
| .FU | .UF | ML-Function |
| .MV | .VM | ML-Value |
| .TP | .PT | ML-Type (generic) |
| .CL | .LC | ML-Class |
| .CI | .IC | C |
| .IN | .NI | Generic Interface Paragraph |
| .EX | .XE | Example Paragraph |
| .{ | .} | Preformatted Paragraph |
| .PA | .AP | A named Paragraph |
| .IO | .OI | An Introduction Paragraph |
| .S1 | .1S | Generic Section |
| .S2 | .2S | Generic Subsection |
| .S3 | .3S | Generic Unit |
| .S4 | .4S | Generic Subunit |
| Compile and use of the MlDoC package | MlDoC dot commands |
ocamlc -c doc_core.ml
ocamlc -c doc_html.mli
ocamlc -c doc_html.ml
ocamlc -c doc_latex.mli
ocamlc -c doc_latex.ml
ocamlc -c doc_text.mli
ocamlc -c doc_text.ml
ocamlc -c doc_help.ml
ocamlc -a doc_core.cmo
doc_html.cmo
doc_latex.cmo
doc_text.cmo
doc_help.cmo -o mldoc.cma
|
vamcomp doc_core.ml
vamcomp doc_html.mli
vamcomp doc_html.ml
vamcomp doc_latex.mli
vamcomp doc_latex.ml
vamcomp doc_text.mli
vamcomp doc_text.ml
vamcomp doc_help.ml
vamar doc_core.cmo
doc_html.cmo
doc_latex.cmo
doc_text.cmo
doc_help.cmo -o mldoc.cma
|
| Package: mldoc |
| ML-Module: doc_core | Package: mldoc |
| Programming Interface | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| Programming Interface | ||||||||||||
|
||||||||||||
|
| Programming Interface | ||||||||||||||||||
|
||||||||||||||||||
|
||||||||||||||||||
|
| Programming Interface | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| Example |
let al = atoms_of_file "mldoc.man" ;;
let st = tree_of_atoms al ;;
html_of_tree ds [HTML_single_doc "mldoc_man.html"] [];;
tex_of_tree ds [TEX_doc_name "mldoc.tex";
TEX_color;
TEX_link_ref;
] [];
text_of_tree ds [TEXT_doc_name "mldoc.txt"] [];
|
| ML-Module: doc_html | Package: mldoc |
| Programming Interface | ||||||||||||||||||||||||
|
| HTML_single_doc of string | Only create a single HTML file instead of a collection of files, each for one section. The string is the file name. |
| ML-Module: doc_latex | Package: mldoc |
| Programming Interface | ||||||||||||||||||||||||
|
| TEX_doc_name of string | The name of the output file. The default setting is manual.tex . |
| TEX_head_inline | Don't perform a page break on section boundaries. |
| TEX_color | Ouput colored manual pages. Special color commands for dvips are created. Default is color off. |
| TEX_no_toc | Don't print a table of content. Default is print a TOC. |
| TEX_link_ref | Generate links in the manual (page references). Default is no links. |
| ML-Module: doc_text | Package: mldoc |
| Programming Interface | ||||||||||||||||||||||||
|
| TEXT_doc_name of string | The output file name if any. Without this option, the output is printied to the current standard out channel. |
| TEXT_terminal | Enhanced text ouput with special terminal control command (underlined...). Default is no special commands. |
| TEXT_notoc | Don't print a table of content. |
| ML-Module: doc_help | Package: mldoc |
| Programming Interface | ||||||||||||||||||||
|
||||||||||||||||||||
|
||||||||||||||||||||
|
||||||||||||||||||||
|
||||||||||||||||||||
|
||||||||||||||||||||
|
||||||||||||||||||||
|
||||||||||||||||||||
|
| Example |
let at = atoms_of_file "mldoc.man" in let ds = tree_of_atoms at in help_load ds; |