~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/htmlparser/tests/htmlgen/htmlgen.html

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
 
2
<html>
 
3
<head>
 
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]">
 
7
   <title>htmlgen</title>
 
8
</head>
 
9
<body>
 
10
&nbsp;
 
11
<table COLS=1 WIDTH="100%" BGCOLOR="#FFFFCC" >
 
12
<tr>
 
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>
 
15
</tr>
 
16
</table>
 
17
 
 
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 &lt;BODY> element. To accomplish this, begin with
 
27
a small HTML fragment file given below:</font></font>
 
28
<br>&nbsp;
 
29
<table COLS=1 WIDTH="30%" BGCOLOR="#CCCCCC" >
 
30
<tr>
 
31
<td><font face="Verdana"><font size=-1>&lt;html></font></font>
 
32
<br><font face="Verdana"><font size=-1>&lt;body></font></font>
 
33
<br><font face="Verdana"><font size=-1>&lt;$0><i>text</i>&lt;/$0></font></font>
 
34
<br><font face="Verdana"><font size=-1>&lt;/body></font></font>
 
35
<br><font face="Verdana"><font size=-1>&lt;/html></font></font></td>
 
36
</tr>
 
37
</table>
 
38
 
 
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 &lt;$0> and &lt;/$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 &lt;$0> and &lt;/$0> will be replaced in each autogenerated
 
50
file with the current value of the $0 argument. So, the first file will
 
51
contain &lt;A> where it sees &lt;$0>, the second will use &lt;B> and so
 
52
on.</font></font>
 
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.&nbsp; 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>
 
58
<br>&nbsp;
 
59
<br>&nbsp;
 
60
<table COLS=1 WIDTH="100%" BGCOLOR="#FFFFCC" >
 
61
<tr>
 
62
<td><b><font face="Verdana"><font size=-1>HTMLGen Command Line Arguments</font></font></b></td>
 
63
</tr>
 
64
</table>
 
65
 
 
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>
 
77
<br>&nbsp;
 
78
<br>&nbsp;
 
79
<table COLS=1 WIDTH="100%" BGCOLOR="#FFFFCC" >
 
80
<tr>
 
81
<td><b><font face="Verdana"><font size=-1>HTMLGen Embedded Text Commands</font></font></b></td>
 
82
</tr>
 
83
</table>
 
84
 
 
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&nbsp;&nbsp; -- 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
 
92
files).</font></font>
 
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>
 
96
<br>&nbsp;
 
97
<br>&nbsp;
 
98
<table COLS=1 WIDTH="100%" BGCOLOR="#FFFFCC" >
 
99
<tr>
 
100
<td><b><font face="Verdana"><font size=-1>Notes and Cautions</font></font></b></td>
 
101
</tr>
 
102
</table>
 
103
 
 
104
<blockquote>
 
105
<li>
 
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>
 
110
</blockquote>
 
111
 
 
112
</body>
 
113
</html>