File: caml2html.html

package info (click to toggle)
caml2html 1.4.1-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 852 kB
  • sloc: ml: 6,339; makefile: 302
file content (148 lines) | stat: -rw-r--r-- 4,679 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<html>
<head>
  <title>How to use Caml2html</title>
</head>

<body style="font-family:sans-serif; background-color:white; color:black">
<center><h1>How to use Caml2html</h1></center>

<p>
More information about Caml2html 
<a href="http://martin.jambon.free.fr/caml2html.html">here</a>.

<h2>Usage</h2>

<pre>

Caml2html colorizes a set of OCaml source files (.ml, .mli, .mll, .mly, ...).
Type annotations will be shown when the mouse pointer passes over
an expression if the corresponding .annot file is available.
To obtain a .annot file, compile with ocamlc -dtypes or ocamlopt -dtypes.

Usage: caml2html [options] file1 ... fileN
Options:
  -annotfilter {innermost|outermost}
          choose whether innermost or outermost type annotations
          should be used (default: innermost)
  -charset &lt;charset&gt;
          specify charset to use (default: iso-8859-1)
  -css 
          use CSS named style.css for styling
  -cssurl &lt;URL&gt;
          use the given URL as CSS for styling
  -inhead 
          use default styling and place it in the &lt;head&gt; section
          of the document (default when applicable)
  -inline 
          use inline styling (HTML only, default fallback
          if -inhead is not applicable)
  -body 
          output only document's body, for inclusion into an 
          existing document (see also -make-css and -make-latex-defs)
  -ln 
          add line number at the beginning of each line
  -hc 
          comments are treated as raw HTML or LaTeX code
          (no newlines inside of tags)
  -t 
          add a title to the HTML page
  -nf 
          do not add footnotes to the HTML page
  -ie7 
          drop support for type annotations on Internet Explorer 6 and older
  -noannot 
          do not insert type annotations as read from .annot files 
          (HTML output only)
  -notab 
          do not replace tabs by spaces
  -tab &lt;integer&gt;
          replace tab by n spaces (default = 8)
  -d &lt;directory&gt;
          generate files in directory dir, rather than in current directory
  -o &lt;filename&gt;
          output file
  -v 
          print version number to stdout and exit
  -make-css &lt;filename&gt;
          create CSS file with default color definitions and exit
  -ext &lt;NAME:CMD&gt;
          use the given external command CMD to handle comments that start
          with (*NAME. NAME must be a lowercase identifier.
  -latex 
          output LaTeX code instead of HTML.
  -make-latex-defs &lt;filename&gt;
          create a file containing the default LaTeX color definitions
          and matching highlighting commands, and exit.
          \usepackage{alltt,color} is not included.
  -help  Display this list of options
  --help  Display this list of options
</pre>


<h2>Examples</h2>

<p>Process a single file <code>code.ml</code>:
<pre>caml2html code.ml</pre>

<p>Same thing with a title for the page:
<pre>caml2html -t code.ml</pre>

<p>Process a file with a title and line numbers:
<pre>caml2html -t -ln code.ml</pre>

<p>Process a file with a title, line numbers and replace tabs by 4 spaces:
<pre>caml2html -t -ln -tab 4 code.ml</pre>

<p>Process a file without footnotes (the most simple output):
<pre>caml2html -nf code.ml</pre>

<p>Process a file and use a css (style.css):
<pre>caml2html -css code.ml</pre>

<p>Process a file and use a specific css (http://blabla.com/style2.css):
<pre>caml2html -css -cssurl http://blabla.com/style2.css code.ml</pre>

<p>Read from stdin and output to stdout:
<pre>caml2html</pre>

<p>Process many files into a single file:
<pre>caml2html -o result.html *.mli *.ml</pre>

<p>Process many files, and create one HTML page for each file:
<pre>caml2html *.ml</pre>

<p>Same thing, but write result in the <code>html</code> directory:
<pre>caml2html -d html *.ml</pre>

<p>Same thing, but write result in the <code>html</code> directory:
<pre>caml2html -d html *.ml</pre>

<p>You can specify the character encoding with the -charset option:
<pre>
caml2html -charset euc-jp input.ml -o output.html
</pre>

<p>You can write the comments in HTML. This lets you add simple
formatting such as hyperlinks. Beware that one HTML tag cannot 
span over several lines, and that the characters 
<code>&lt;</code>, <code>&gt;</code> and <code>&amp;</code>
must be written as <code>&amp;lt;</code>, <code>&amp;gt;</code> 
and <code>&amp;amp;</code>.
<pre>
(* This is file1.ml.
   &lt;a href="#file2.ml"&gt;This is a link to file2.ml&lt;/a&gt;. *)
...
</pre>
<p>
In this case, use the <code>-hc</code> option:
<pre>
caml2html -hc file1.ml file2.ml -o result.html
</pre>



<hr>
<p>
<em>This document was not generated by caml2html!</em>
</body>
</html>