1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
4
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5
<meta name="Author" content="Rick Gessner">
6
<meta name="GENERATOR" content="Mozilla/4.6 [en] (WinNT; U) [Netscape]">
11
<table COLS=1 WIDTH="100%" BGCOLOR="#FFFFCC" >
13
<td><b><font face="Verdana"><font size=-1>Using HTMLGen</font></font></b>
14
<br><font face="Verdana"><font size=-2>Version 1.0</font></font></td>
18
<p><font face="Verdana"><font size=-1>HTMLGen is a C++ text-processing
19
utility that lets users quickly generate HTML testcases. While HTMLGen
20
is not restricted to generating HTML files, the program does understand
21
the set of known HTML tags. HTMLGen takes user supplied file fragments
22
and command line arguments as input, and automatically generates a series
23
of derived HTML files.</font></font>
24
<p><font face="Verdana"><font size=-1>Here's a quick example: Let's say
25
you want to create a series of tests to verify that Gecko correctly renders
26
every tag inside the <BODY> element. To accomplish this, begin with
27
a small HTML fragment file given below:</font></font>
29
<table COLS=1 WIDTH="30%" BGCOLOR="#CCCCCC" >
31
<td><font face="Verdana"><font size=-1><html></font></font>
32
<br><font face="Verdana"><font size=-1><body></font></font>
33
<br><font face="Verdana"><font size=-1><$0><i>text</i></$0></font></font>
34
<br><font face="Verdana"><font size=-1></body></font></font>
35
<br><font face="Verdana"><font size=-1></html></font></font></td>
39
<p><font face="Verdana"><font size=-1>Notice that the file looks like a
40
typical HTML file, except for the tags that read <$0> and </$0>.
41
These are macros, which are content that will be replaced by arguments
42
provided on the HTMLGen command line. To finish our example, simply run
43
HTMLGen with the following command line arguments:</font></font>
44
<pre><tt><font color="#3333FF">HTMLGen -f test1.html a-z</font></tt></pre>
45
<font face="Verdana"><font size=-1>This instructs HTML to read the test1.html
46
file and use it as a template. Next, the tag-range argument "a-z" instructs
47
HTMLGen to autogenerate a file for each HTML tag between A and Z. HTMLGen
48
uses this argument as the 0th element of its macro substitution process.
49
The macros <$0> and </$0> will be replaced in each autogenerated
50
file with the current value of the $0 argument. So, the first file will
51
contain <A> where it sees <$0>, the second will use <B> and so
53
<p><font face="Verdana"><font size=-1>The result of running HTMLGen against
54
the given template with these arguments is that you'll get a new file for
55
each tag we see in the range between A..Z. Note that in this example
56
we're emitting valid HTML, but that is not a requirement. You can use HTMLGen
57
to generate lots of illegal content for testing as well.</font></font>
60
<table COLS=1 WIDTH="100%" BGCOLOR="#FFFFCC" >
62
<td><b><font face="Verdana"><font size=-1>HTMLGen Command Line Arguments</font></font></b></td>
66
<p><font face="Verdana"><font size=-1>The arguments you use for controlling
67
HTMLGen always have the same form, as shown:</font></font>
68
<p><tt><font color="#3333FF">HTMLGen -f test1.html [-o outfile name] taglist0
69
[,taglist1, ..., taglist9]</font></tt>
70
<p><font face="Verdana"><font size=-1>The first argument is always the
71
name of the template file to read.</font></font>
72
<br><font face="Verdana"><font size=-1>The (optional) second argument is
73
the name of the output file.</font></font>
74
<br><font face="Verdana"><font size=-1>The 3rd argument on represent represent
75
tag sequences to be used in macro substitution. These can have one of three
76
forms: 1) a single tag; 2) a list of tags (a,b,c); 3) a range of tags (a-z).</font></font>
79
<table COLS=1 WIDTH="100%" BGCOLOR="#FFFFCC" >
81
<td><b><font face="Verdana"><font size=-1>HTMLGen Embedded Text Commands</font></font></b></td>
85
<p><font face="Verdana"><font size=-1>In addition to the command line arguments,
86
HTMLGen can also respond to special markup found inside your template files.
87
Commands you can use inside your templates include:</font></font>
88
<p><font face="Verdana"><font size=-1>@file -- this gets replaced
89
with the name of the current output file.</font></font>
90
<br><font face="Verdana"><font size=-1>@next -- this gets replaced with
91
the name of the <i>next</i> output file (useful for creating links between
93
<br><font face="Verdana"><font size=-1>@import <i>filename </i>-- this
94
causes the contents of <i>filename</i> to be inserted into the current
95
document.</font></font>
98
<table COLS=1 WIDTH="100%" BGCOLOR="#FFFFCC" >
100
<td><b><font face="Verdana"><font size=-1>Notes and Cautions</font></font></b></td>
106
<font face="Verdana"><font size=-1>The first note of caution is that HTMLGen
107
can produce a large number of test files in very little time. You should
108
be careful when you specify arguments because the combinatorics add up
109
to a potentially<i> big</i> document set.</font></font></li>