1 \" $Id: ocamldoc.m 9282 2009-05-27 14:35:27Z doligez $
5 \" .de Sh \" Subsection heading
15 ocamldoc \- The Objective Caml documentation generator
27 The Objective Caml documentation generator
29 generates documentation from special comments embedded in source files. The
30 comments used by OCamldoc are of the form
32 and follow the format described in the
33 .IR "The Objective Caml user's manual" .
35 OCamldoc can produce documentation in various formats: HTML, LaTeX, TeXinfo,
38 dependency graphs. Moreover, users can add their own
41 In this manpage, we use the word
43 to refer to any of the following parts of an OCaml source file: a type
44 declaration, a value, a module, an exception, a module type, a type
45 constructor, a record field, a class, a class type, a class method, a class
46 value or a class inheritance clause.
50 The following command-line options determine the format for the generated
51 documentation generated by
53 .SS "Options for choosing the output format"
56 Generate documentation in HTML default format. The generated HTML pages are
57 stored in the current directory, or in the directory specified with the
59 option. You can customize the style of the generated pages by editing the
62 file, or by providing your own style sheet using option
66 is not generated if it already exists.
69 Generate documentation in LaTeX default format. The generated LaTeX document
72 or in the file specified with the
74 option. The document uses the style file
76 This file is generated when using the
78 option, if it does not already exist. You can change this file to customize
79 the style of your LaTeX documentation.
82 Generate documentation in TeXinfo default format. The generated LaTeX document
85 or in the file specified with the
90 Generate documentation as a set of Unix man pages. The generated pages are
91 stored in the current directory, or in the directory specified with the
96 Generate a dependency graph for the toplevel modules, in a format suitable for
97 displaying and processing by
101 tool is available from
102 .IR http://www.research.att.com/sw/tools/graphviz/ .
103 The textual representation of the graph is written to the file
105 or to the file specified with the
108 .BI dot \ ocamldoc.out
112 Dynamically load the given file (which extension usually is .cmo or .cma),
113 which defines a custom documentation generator.
114 If the given file is a simple one and does not exist in
115 the current directory, then ocamldoc looks for it in the custom
116 generators default directory, and in the directories specified with the
121 Display the custom generators default directory.
124 Add the given directory to the path where to look for custom generators.
125 .SS "General options"
128 Generate files in directory
130 rather than the current directory.
133 Dump collected information into
135 This information can be read with the
137 option in a subsequent invocation of
141 Hide the given complete module names in the generated documentation.
143 is a list of complete module names are separated by commas (,),
144 without blanks. For instance:
145 .IR Pervasives,M2.M3 .
147 .B \-inv\-merge\-ml\-mli
148 Reverse the precedence of implementations and interfaces when merging.
149 All elements in implementation files are kept, and the
151 option indicates which parts of the comments in interface files are merged with
152 the comments in implementation files.
155 Always keep the source code for values, methods and instance variables, when
156 available. The source code is always kept when a .ml
157 file is given, but is by default discarded when a .mli
158 is given. This option allows to always keep the source code.
161 Load information from
163 which has been produced by
164 .BR ocamldoc\ \-dump .
167 options can be given.
170 Specify merge options between interfaces and implementations.
172 can be one or several of the following characters:
204 .B \-no\-custom\-tags
205 Do not allow custom @-tags.
208 Keep elements placed after the
213 Output the generated documentation to
217 This option is meaningful only in conjunction with the
218 .BR \-latex , \ \-texi ,\ or \ \-dot
222 Pipe sources through preprocessor
226 Sort the list of top-level modules before generating the documentation.
229 Remove blank characters until the first asterisk ('*') in each line of comments.
234 as the title for the generated documentation.
239 as ocamldoc text to use as introduction (HTML, LaTeX and TeXinfo only).
240 For HTML, the file is used to create the whole "index.html" file.
243 Verbose mode. Display progress information.
246 Print the version string and exit.
249 Treat Ocamldoc warnings as errors.
252 Do not print OCamldoc warnings.
254 .BR \-help \ or \ \-\-help
255 Display a short usage summary and exit.
256 .SS "Type-checking options"
258 calls the Objective Caml type-checker to obtain type informations. The
259 following options impact the type-checking phase. They have the same meaning
261 .BR ocamlc (1)\ and \ ocamlopt (1)
267 to the list of directories search for compiled interface files (.cmi files).
270 Ignore non-optional labels in types.
273 Allow arbitrary recursive types. (See the
277 .SS "Options for generating HTML pages"
278 The following options apply in conjunction with the
283 Display the complete list of parameters for functions and methods.
285 .BI \-css\-style \ filename
288 as the Cascading Style Sheet file.
291 Colorize the OCaml code enclosed in [ ] and \\{[ ]\\}, using colors to emphasize
292 keywords, etc. If the code fragments are not syntactically correct, no color
296 Generate only index files.
299 Use a short form to display functors:
300 .B "module M : functor (A:Module) -> functor (B:Module2) -> sig .. end"
302 .BR "module M (A:Module) (B:Module2) : sig .. end" .
303 .SS "Options for generating LaTeX files"
304 The following options apply in conjunction with the
308 .B \-latex\-value\-prefix prefix
309 Give a prefix to use for the labels of the values in the generated LaTeX
310 document. The default prefix is the empty string. You can also use the options
311 .BR -latex-type-prefix ,
312 .BR -latex-exception-prefix ,
313 .BR -latex-module-prefix ,
314 .BR -latex-module-type-prefix ,
315 .BR -latex-class-prefix ,
316 .BR -latex-class-type-prefix ,
317 .BR -latex-attribute-prefix ,\ and
318 .BR -latex-method-prefix .
320 These options are useful when you have, for example, a type and a value
321 with the same name. If you do not specify prefixes, LaTeX will complain about
322 multiply defined labels.
324 .BI \-latextitle \ n,style
325 Associate style number
327 to the given LaTeX sectioning command
330 .BR section or subsection .
331 (LaTeX only.) This is useful when including the generated document in another
332 LaTeX document, at a given sectioning level. The default association is 1 for
333 section, 2 for subsection, 3 for subsubsection, 4 for paragraph and 5 for
337 Suppress header in generated documentation.
340 Do not generate a table of contents.
343 Suppress trailer in generated documentation.
346 Generate one .tex file per toplevel module, instead of the global
349 .SS "Options for generating TeXinfo files"
350 The following options apply in conjunction with the
355 Escape accented characters in Info files.
359 Specify Info directory entry.
362 Specify section of Info directory.
365 Suppress header in generated documentation.
368 Do not build index for Info files.
371 Suppress trailer in generated documentation.
372 .SS "Options for generating dot graphs"
373 The following options apply in conjunction with the
377 .BI \-dot\-colors \ colors
378 Specify the colors to use in the generated dot code. When generating module
381 uses different colors for modules, depending on the directories in which they
382 reside. When generating types dependencies,
384 uses different colors for types, depending on the modules in which they are
387 is a list of color names separated by commas (,), as in
389 The available colors are the ones supported by the
393 .B \-dot\-include\-all
394 Include all modules in the
396 output, not only modules given on the command line or loaded with the
401 Perform a transitive reduction of the dependency graph before outputting the
402 dot code. This can be useful if there are a lot of transitive dependencies
403 that clutter the graph.
406 Output dot code describing the type dependency graph instead of the module
408 .SS "Options for generating man files"
409 The following options apply in conjunction with the
414 Generate man pages only for modules, module types, classes and class types,
415 instead of pages for all elements.
417 .BI \-man\-suffix suffix
418 Set the suffix used for generated man filenames. Default is o, as in
421 .BI \-man\-section section
422 Set the section number used for generated man filenames. Default is 3.
430 .IR "The Objective Caml user's manual",
431 chapter "The documentation generator".