1 <!doctype linuxdoc system>
4 <title>ca65html Users Guide
5 <author>Ullrich von Bassewitz, <htmlurl url="mailto:uz@cc65.org" name="uz@cc65.org">
9 ca65html is an assembler source to HTML converter. It is very useful if you
10 want to publish your assembler sources in the web.
13 <!-- Table of contents -->
16 <!-- Begin the document -->
20 ca65html converts assembler source files written for use with the <tt/<htmlurl
21 url="ca65.html" name="ca65">/ crossassembler into HTML. It is a standalone
22 tool written in Perl, and as such it does not understand the structure of
23 assembler sources in the same depth as ca65 does, so it may fail in very rare
24 cases. In all other cases it generates very nice output.
30 <sect1>Command line option overview<p>
32 The HTML converter accepts the following options:
35 ---------------------------------------------------------------------------
36 Usage: ca65html [options] file ...
38 --bgcolor c Use background color c instead of #FFFFFF
39 --colorize Colorize the output (generates non standard HTML)
40 --commentcolor c Use color c for comments instead of #B22222
41 --crefs Generate references to the C source file(s)
42 --ctrlcolor c Use color c for directives instead of #228B22
43 --cvttabs Convert tabs to spaces in the output
45 --htmldir dir Specify directory for HTML files
46 --indexcols n Use n columns on index page (default 6)
47 --indexname file Use file for the index file instead of index.html
48 --indexpage Create an index page
49 --indextitle title Use title as the index title instead of Index
50 --keywordcolor c Use color c for keywords instead of #A020F0
51 --linelabels Generate a linexxx HTML label for each line
52 --linenumbers Add line numbers to the output
53 --linkstyle style Use the given link style
54 --replaceext Replace source extension instead of appending .html
55 --textcolor c Use text color c instead of #000000
56 --verbose Be more verbose
57 ---------------------------------------------------------------------------
61 <sect1>Command line options in detail<p>
63 Here is a description of all the command line options:
67 <tag><tt>--bgcolor c</tt></tag>
69 Set the background color. The argument c must be a valid HTML color, usually
70 given as RGB triplet in the form <tt/#rrggbb/, where r, g and b are the
71 respective red, green and blue parts as two digit hex values. The default is
72 <tt/#FFFFFF/ (white). This color is used in the <tt/<body>/ tag of the
73 generated HTML output.
76 <tag><tt>--colorize</tt></tag>
78 Colorize the output. The converter outputs processor instructions, assembler
79 control commands and comments in different colors.
81 While this make the output look very nice, it generates invalid HTML,
82 because using colors in a <tt/<pre>/ environment is not allowed.
83 However, most browsers display it well, and it is used by several other
84 tools, so it's up to you.
87 <tag><tt>--commentcolor c</tt></tag>
89 Set the color used for comments. The argument c must be a valid HTML color,
90 usually given as RGB triplet in the form <tt/#rrggbb/, where r, g and b are
91 the respective red, green and blue parts as two digit hex values. The
92 default is <tt/#B22222/ (red).
94 Note that this option has no effect if <tt/--colorize/ is not also given.
97 <tag><tt>--crefs</tt></tag>
99 Generate references to the C file, when a <tt/.dbg/ command is found with a
100 file name. The converter assumes that the C source was also converted into
101 HTML (for example by use of <tt/c2html/), has the name <tt/file.c.html/, and
102 lives in the same directory as the assembler file. If the <tt/.dbg/
103 directive specifies a line, a link to the correct line in the C file is
104 generated, using a label in the form <tt/linexxx/, as it is created by
105 <tt/c2html/ by use of the <tt/-n/ option.
108 <tag><tt>--commentcolor c</tt></tag>
110 Set the color used for assembler control commands. The argument c must be a
111 valid HTML color, usually given as RGB triplet in the form <tt/#rrggbb/,
112 where r, g and b are the respective red, green and blue parts as two digit
113 hex values. The default is <tt/#228B22/ (green).
115 Note that this option has no effect if <tt/--colorize/ is not also given.
118 <tag><tt>--cvttabs</tt></tag>
120 Convert tabs in the input into spaces in the output, assuming the standard
121 tab width of 8. This is useful if the <tt/--linenumbers/ option is used to
122 retain the indentation.
125 <tag><tt>--help</tt></tag>
127 Print the command line option summary shown above.
130 <tag><tt>--htmldir dir</tt></tag>
132 Specify an output directory for the generated HTML files.
135 <tag><tt>--indexcols n</tt></tag>
137 Use n columns on the index page. This option has no effect if used without
141 <tag><tt>--indexname name</tt></tag>
143 Use another index file name instead of <tt/index.html/. This option has no
144 effect if used without <tt/--indexpage/.
147 <tag><tt>--indexpage</tt></tag>
149 Causes the converter to generate an index page listing all label names and
150 exports found in the converted files.
153 <tag><tt>--indextitle title</tt></tag>
155 Use "title" as the title of the index page. This option has no effect if
156 used without <tt/--indexpage/.
159 <tag><tt>--keywordcolor c</tt></tag>
161 Set the color used for processor instructions. The argument c must be a
162 valid HTML color, usually given as RGB triplet in the form <tt/#rrggbb/,
163 where r, g and b are the respective red, green and blue parts as two digit
164 hex values. The default is <tt/#A020F0/ (purple).
166 Note that this option has no effect if <tt/--colorize/ is not also given.
168 <tag><tt>--linelabels</tt></tag>
170 Generate a label for each line using the name <tt/linexxx/ where xxx is the
173 Note: The converter will not make use of this label. Use this option if you
174 have other HTML pages referencing the converted assembler file.
177 <tag><tt>--linenumbers</tt></tag>
179 Generate line numbers on the left side of the output.
182 <tag><tt>--linkstyle n</tt></tag>
184 Influences the style used when generating links for imports. If n is zero
185 (the default), the converter creates a link to the actual symbol if it is
186 defined somewhere in the input files. If not, it creates a link to the
187 <tt/.import/ statement. If n is one, the converter will always generate a
188 HTML link to <tt/.import/ statement.
191 <tag><tt>--replaceext</tt></tag>
193 Replace the file extension of the input file instead of appending <tt/.html/
194 when generating the output file name.
197 <tag><tt>--textcolor c</tt></tag>
199 Set the color for normal text. The argument c must be a valid HTML color,
200 usually given as RGB triplet in the form <tt/#rrggbb/, where r, g and b are
201 the respective red, green and blue parts as two digit hex values. The
202 default is <tt/#000000/ (black). This color is used in the <tt/<body>/
203 tag of the generated HTML output.
206 <tag><tt>--verbose</tt></tag>
208 Increase the converter verbosity. Without this option, ca65html is quiet
209 when working. If you have a slow machine and lots of files to convert, you
210 may like a little bit more progress information.
216 <sect>Peculiarities<p>
218 <sect1>Cross links<p>
220 Since ca65html is able to generate links between modules, the best way to use
221 it is to supply all modules to it in one run, instead of running each file
222 separately through it.
225 <sect1>Include files<p>
227 For now, ca65html will not read files included with <tt/.include/. Specifying
228 the include files as normal input files on the command line works in many
232 <sect1>Conversion errors<p>
234 Since ca65html does not really parse the input, but does most of its work
235 applying text patterns, it doesn't know anything about scoping and advanced
236 features of the assembler. This means that it may miss a label may choose the
237 wrong color for an item in rare cases. Since it's just a tool for displaying
238 sources in a nice form, I think that's ok. Anyway, if you find a conversion
239 problem, you can send me a short piece of example input code. If possible, I
243 <sect1>Colorization<p>
245 While having colors in the output looks really nice, it has two drawbacks:
249 <item>The output is not standard compliant HTML, because <tt/<font>/
250 tags are use in a <tt/<pre>/ environment. This works with all browsers
251 I've tested, but it may not work with the one you're using.
253 <item>Since lots of <tt/<font>/ tags are created in the output, the size
254 of the output file will literally explode. This seems to be the price, you
255 have to pay for color...
260 <sect>Bugs/Feedback<p>
262 If you have problems using the converter, if you find any bugs, or if you're
263 doing something interesting with the assembler, I would be glad to hear from
264 you. Feel free to contact me by email (<htmlurl url="mailto:uz@cc65.org"
265 name="uz@cc65.org">).
271 ca65html is (C) Copyright 2000-2003 Ullrich von Bassewitz. For its use the
272 following conditions apply:
274 This software is provided 'as-is', without any expressed or implied
275 warranty. In no event will the authors be held liable for any damages
276 arising from the use of this software.
278 Permission is granted to anyone to use this software for any purpose,
279 including commercial applications, and to alter it and redistribute it
280 freely, subject to the following restrictions:
283 <item> The origin of this software must not be misrepresented; you must not
284 claim that you wrote the original software. If you use this software
285 in a product, an acknowledgment in the product documentation would be
286 appreciated but is not required.
287 <item> Altered source versions must be plainly marked as such, and must not
288 be misrepresented as being the original software.
289 <item> This notice may not be removed or altered from any source