annotate doc/wiki2docbook/html2db/index.src.html @ 1773:2ae81598b254

scripts for converting wiki documentation to docbook
author nadvornik
date Sun, 22 Nov 2009 09:12:22 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1773
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
3 <!ENTITY html2db "<code>html2db.xsl</code>">
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
4 ]>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
5 <html xmlns:x="http://www.w3.org/1999/xhtml"
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
6 xmlns:db="urn:docbook">
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
7 <head>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
8 <title>This title is ignored</title>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
9 </head>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
10 <body>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
11
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
12 <h1>html2db.xsl</h1>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
13
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
14 <!-- The xmlns attribute escapes into the Docbook namespace -->
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
15 <articleinfo xmlns="urn:docbook">
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
16 <author>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
17 <firstname>Oliver</firstname>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
18 <surname>Steele</surname>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
19 </author>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
20 <revhistory>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
21 <revision>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
22 <revnumber>1</revnumber>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
23 <date>2004-07-30</date>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
24 </revision>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
25 <revision>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
26 <revnumber>1.0.1</revnumber>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
27 <date>2004-08-01</date>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
28 <revdescription><para>Editorial changes to the
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
29 readme.</para></revdescription>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
30 </revision>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
31 </revhistory>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
32 <date>2004-07-30</date>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
33 </articleinfo>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
34
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
35 <h2>Overview</h2>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
36
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
37 <p>&html2db; converts an XHTML source document into a Docbook output
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
38 document. It provides features for customizing the generation of the
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
39 output, so that the output can be tuned by annotating
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
40 the source, rather than hand-editing the output. This makes it useful
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
41 in a processing pipeline where the source documents are maintained in
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
42 HTML, although it can be used as a one-time conversion tool
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
43 too.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
44
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
45 <p>This document is an example of &html2db; used in conjunction with
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
46 the Docbook XSL stylesheets. The <a href="index.src.html">source
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
47 file</a> is an XHTML file with some embedded Docbook elements and
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
48 processing instructions. &html2db; compiles it into a <a
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
49 href="index.xml">Docbook document</a>, which can be used to generate
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
50 this output file (which includes a Table of Contents), a <a
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
51 href="docs/index.html">chunked HTML file</a>, a <a
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
52 href="html2db.pdf">PDF</a>, or other formats.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
53
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
54 <h2>Features</h2>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
55 <dl>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
56 <dt>XSLT implementation</dt>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
57 <dd>This tool is designed to be embedded within an XSLT processing
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
58 pipeline. <code>html2html.xslt</code> can be used in a custom
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
59 stylesheet or integrated into a larger system. See <a
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
60 href="#embedding">Overriding</a>.</dd>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
61
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
62 <dt>Customizable</dt>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
63 <dd>The output can be customized by the means of additonal markup in
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
64 the XHMTL source. See the section on <a
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
65 href="#customization">customization</a>.</dd>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
66
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
67 <dt>Creates outline structure</dt>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
68 <dd><code>h1</code>, <code>h2</code>, etc. are turned into nested
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
69 <code>section</code> and <code>title</code> elements (as opposed to
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
70 bridge heads).</dd>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
71
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
72 <dt>Accepts a wide variety of XHTML</dt>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
73 <dd>In particular, &html2db; automatically wraps <dfn>naked item
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
74 text</dfn> (text that is not enclosed in a <code>&lt;p&gt;</code>)
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
75 inside a table cell or list item. Naked text is a common property of
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
76 XHTML documents, but needs to be clothed to create valid
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
77 Docbook.<db:footnote><p>This feature is limited. See <a
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
78 href="#implicit-blocks">Implicit Blocks</a>.)</p></db:footnote></dd>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
79
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
80 </dl>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
81
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
82 <h2>Requirements</h2>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
83 <ul>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
84 <li>Java: JRE or JDK 1.3 or greater.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
85 <li>Xalan 2.5.0.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
86 <li>Familiarity with installing and running JAR files.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
87 </ul>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
88
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
89 <p>&html2db; might work with earlier versions of Java and Xalan, and
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
90 it might work with other XSLT processors such as Saxon and
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
91 xsltproc.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
92
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
93 <h2>License</h2>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
94 <p>This software is released under the Open Source <a href="http://www.opensource.org/licenses/artistic-license.php">Artistic License</a>.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
95
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
96 <h2>Installation</h2>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
97 <ul>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
98 <li>Install JRE 1.3 or higher.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
99 <li>Install Xalan, if necessary.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
100 <li>Download <code>html2db-1.zip</code> from <a href="http://osteele.com/sources/html2db.zip">http://osteele.com/sources/html2db-1.zip</a>.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
101 <li>Unzip <code>html2db-1.zip</code>.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
102 </ul>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
103
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
104 <h2>Usage</h2>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
105 <p>Use Xalan to process an XHTML source file into a Docbook file:</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
106
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
107 <pre class="example">
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
108 java org.apache.xalan.xslt.Process -XSL html2dbk.xsl -IN doc.html &gt; doc.xml
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
109 </pre>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
110
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
111 <p>See <a href="index.src.html"><code>index.src.html</code></a> for an
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
112 example of an input file.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
113
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
114 <p>If your source files are in HTML, not XHTML, you may find the <a
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
115 href="http://tidy.sourceforge.net/">Tidy</a> tool useful. This is a
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
116 tool that converts from HTML to XHTML, and can be added to the front
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
117 of your processing pipeline.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
118
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
119 <p>(If you need to process HTML and you don't know or can't figure out
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
120 from context what a processing pipeline is, &html2db; is probably not
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
121 the right tool for you, and you should look for a local XML or Java
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
122 guru or for a commercially supported product.)</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
123
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
124 <h2>Specification</h2>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
125
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
126 <h3>XHTML Elements</h3>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
127 <p><code>code/i</code> stands for "an <code>i</code> element
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
128 immediately within a <code>code</code> element". This notation is
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
129 from XPath.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
130
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
131 <p>XHTML elements must be in the XHTML Transitional namespace,
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
132 <code>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</code>.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
133
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
134 <table>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
135 <tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
136 <th>XHTML</th>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
137 <th>Docbook</th>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
138 <th>Notes</th>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
139 </tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
140
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
141 <tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
142 <td><code>b</code>, <code>i</code>, <code>em</code>, <code>strong</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
143 <td><code>emphasis</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
144 <td>The <code>role</code> attribute is the original tag name</td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
145 </tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
146
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
147 <tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
148 <td><code>dfn</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
149 <td><code>glossitem</code>, and also <code>primary</code> <code>indexterm</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
150 </tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
151
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
152 <tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
153 <td><code>code/i</code>, <code>tt/i</code>, <code>pre/i</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
154 <td><code>replaceable</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
155 <td>In practice, <code>i</code> within a monospace content is usually used to mean replaceable text. If you're using it for emphasis, use <code>em</code> instead.</td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
156 </tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
157
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
158 <tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
159 <td><code>pre</code>, <code>body/code</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
160 <td><code>programlisting</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
161 </tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
162
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
163 <tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
164 <td><code>img</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
165 <td><code>inlinemediaobject/imageobject/imagedata</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
166 <td>In an inline context.</td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
167 </tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
168
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
169 <tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
170 <td><code>img</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
171 <td><code>[informal]figure/mediaobject/imageobject/imagedata</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
172 <td>If it has a <code>title</code> attribute or <code>db:title</code> it's wrapped in a <code>figure</code>. Otherwise it's wrapped in an <code>informalfigure</code>.</td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
173 </tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
174
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
175 <tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
176 <td><code>table</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
177 <td><code>[informal]table</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
178 <td>XHTML <code>table</code> becomes Docbook <code>table</code> if it has a <code>summary</code> attribute; <code>informaltable</code> otherwise.</td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
179 </tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
180
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
181 <tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
182 <td><code>ul</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
183 <td><code>itemizedlist</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
184 <td>But see the processing instruction <a href="#simplelist">below</a>.</td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
185 </tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
186 </table>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
187
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
188
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
189
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
190 <h3>Links</h3>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
191 <table summary="Link Translation">
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
192 <tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
193 <th>XHTML</th>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
194 <th>Docbook</th>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
195 <th>Notes</th>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
196 </tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
197
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
198 <tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
199 <td><code>&lt;a name="<var>name</var>"&gt;</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
200 <td><code>&lt;anchor id="{$anchor-id-prefix}<var>name</var>"&gt;</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
201 <td>An anchor within a <code>h<var>n</var></code> element is attached to the enclosing <code>section</code> as an <code>id</code> attribute instead.</td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
202 </tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
203
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
204 <tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
205 <td><code>&lt;a href="#<var>name</var>"&gt;</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
206 <td><code>&lt;link linkend="{$anchor-id-prefix}<var>name</var>"&gt;</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
207 </tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
208
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
209 <tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
210 <td><code>&lt;a href="<var>url</var>"&gt;</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
211 <td><code>&lt;ulink url="<var>name</var>"&gt;</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
212 </tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
213
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
214 <tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
215 <td><code>&lt;a name="mailto:<var>address</var>"&gt;</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
216 <td><code>&lt;email&gt;<var>address</var>&lt;/email&gt;</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
217 </tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
218
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
219 </table>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
220
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
221 <h3 id="tables">Tables</h3>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
222
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
223 <p>XHTML <code>table</code> support is minimal. &html2db; changes the
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
224 element names and counts the columns (this is necessary to get table
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
225 footnotes to span all the columns), but it does not attempt to deal
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
226 with tables in their full generality.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
227
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
228 <p>An XHTML <code>table</code> with a <code>summary</code> attribute
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
229 generates a <code>table</code>, whose <code>title</code> is the value
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
230 of that summary. An XHTML <code>table</code> without a
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
231 <code>summary</code> generates an <code>informaltable</code>.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
232
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
233 <p>Any <code>tr</code>s that contain <code>th</code>s are pulled to
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
234 the top of the table, and placed inside a <code>thead</code>. Other
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
235 <code>tr</code>s are placed inside a <code>tbody</code>. This matches
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
236 the commanon XHTML <code>table</code> pattern, where the first row is
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
237 a header row.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
238
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
239 <h3 id="implicit-blocks">Implicit Blocks</h3>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
240 <p>XHTML allows <code>li</code>, <code>dd</code>, and <code>td</code>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
241 elements to contain either inline text (for instance,
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
242 <code>&lt;li&gt;a list item&lt;/li&gt;</code>) or block structure
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
243 (<code>&lt;li&gt;&lt;p&gt;a block&lt;/p&gt;&lt;/li&gt;</code>). The
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
244 corresponding Docbook elements require block structure, such as
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
245 <code>para</code>.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
246
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
247 <p>&html2db; provides limited support for wrapping naked text in
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
248 these positions in <code>para</code> elements. If a list item or
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
249 table cell item directly contains text, all text up to the position of
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
250 the first element (or all text, if there is no element) is wrapped in
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
251 <code>para</code>. This handles the simple case of an item that
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
252 directly contains text, and also the case of an item that contains
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
253 text followed by blocks such as paragraphs.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
254
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
255 <p>Note that this algorithm is easily confused. It doesn't
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
256 distinguish between block and inline XHTML elements, so it will only
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
257 wrap the first word in <code>&lt;li&gt;some &lt;b&gt;bold&lt;/b&gt;
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
258 text&lt;/li&gt;</code>, leading to badly formatted output. Twhe
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
259 workaround is to wrap troublesome content in explicit
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
260 <code>&lt;p&gt;</code> tags.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
261
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
262 <h3 id="docbook-elements">Docbook Elements</h3>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
263
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
264 <p>Elements from the Docbook namespace are passed through as is.
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
265 There are two ways to include a Docbook element in your XHTML
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
266 source:</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
267
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
268 <dl>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
269 <dt>Global prefix</dt>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
270 <dd><p>A <dfn>fake Docbook namespace</dfn><db:footnote><p>The fake
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
271 Docbook namespace is <code>urn:docbook</code>. Docbook doesn't really
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
272 have a namespace, and if it did, it wouldn't be this one. See <a
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
273 href="#docbook-namespace">Docbook namespace</a> for a discussion of
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
274 this issue.</p></db:footnote>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
275
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
276 declaration may be added to the document root element. Anywhere in
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
277 the document, the prefix from this namespace declaration may be used
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
278 to include a Docbook element. This is useful if a document contains
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
279 many Docbook elements, such as <code>footnote</code> or
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
280 <code>glossterm</code>, interspersed with XHTML. (In this case it may
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
281 be more convenient to allow these elements in the XHMTL namespace and
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
282 add a customization layer that translates them to docbook elements,
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
283 however. See <a href="#customization">Customization</a>.)</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
284
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
285 <pre class="example"><![CDATA[
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
286 <html xmlns="http://www.w3.org/1999/xhtml"
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
287 xmlns:db="urn:docbook">
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
288 ...
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
289 <p>Some text<db:footnote>and a footnote</db:footnote>.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
290 ]]></pre></dd>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
291
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
292 <dt>Local namespace</dt>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
293 <dd><p>A Docbook element may be introduced along with a prefix-less
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
294 namespace declaration. This is useful for embedding a Docbook
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
295 document fragment (a hierarchy of elements that all use Docbook tags)
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
296 within of a XHTML document.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
297
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
298 <pre class="example"><![CDATA[
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
299 ...
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
300 <articleinfo xmlns="urn:docbook">
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
301 <author>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
302 <firstname>...</firstname>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
303 ...
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
304 ]]></pre></dd>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
305 </dl>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
306
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
307 <p>The source to <a href="index.src.html">this document</a>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
308 illustrates both of these techniques.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
309
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
310 <p class="note">Both these techniques will cause your document to be
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
311 invalid as XHTML. In order to validate an XHTML document that
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
312 contains Docbook elements, you will need to create a custom schema.
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
313 Technically, you then ought to place your document in a different
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
314 namespace, but this will cause &html2db; not to recognize it!</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
315
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
316
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
317 <h3>Output Processing Instructions</h3>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
318
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
319 <p>&html2db; adds a few of processing instructions to the output file.
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
320 The Docbook XSL stylesheets ignore these, but if you write a
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
321 customization layer for Docbook XSL, you can use the information in
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
322 these processing instructions to customize the HTML output. This can
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
323 be used, for example, to set the <code>a</code> <code>onclick</code>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
324 and <code>target</code> attributes in the HTML files that Docbook XSL
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
325 creates to the same values they had in the input document.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
326
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
327 <dl>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
328 <dt><code>&lt;?html2db attribute="<var>name</var>" value="<var>value</var>"?&gt;</code></dt>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
329 <dd>Placed inside a link element to capture the value of the <code>a</code> <code>target</code> and <code>onclick</code> attributes. <var>name</var> is the name of the attribute (<code>target</code> or <code>onclick</code>), and <var>value</var> is its value, with <code>"</code> and <code>\</code> replaced by <code>\"</code> and <code>\\</code>, respectively.</dd>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
330
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
331 <dt><code>&lt;?html2db element="br"?&gt;</code></dt>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
332 <dd>Represents the location of an XHTML <code>br</code> element in the
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
333 source document.</dd>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
334
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
335 </dl>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
336
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
337 <p>You can also include <code>&lt;?db2html?&gt;</code> processing
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
338 instructions in the HTML source document, and they will be copied
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
339 through to the Docbook output file unchanged (as will all other
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
340 processing instructions).</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
341
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
342
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
343 <h2 id="customization">Customization</h2>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
344 <h3>XSLT Parameters</h3>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
345 <dl>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
346 <dt><code>&lt;xsl:param name="anchor-id-prefix" select="''/&gt;</code></dt>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
347 <dd>Prefixed to every id generated from <code>&lt;a name=&gt;</code>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
348 and <code>&lt;a href="#"&gt;</code>. This is useful to avoid
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
349 collisions between multiple documents that are compiled into the
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
350 same book. For instance, if a number of XHTML sources are assembled
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
351 into chapters of a book, you style each source file with a prefix of
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
352 <code><var>docid</var>.</code> where <var>docid</var> is a unique id
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
353 for each source file.</dd>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
354
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
355 <dt><code>&lt;xsl:param name="document-root" select="'article'"/&gt;</code></dt>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
356 <dd>The default document root. This can be overridden by
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
357 <code>&lt;?html2db class="<var>name</var>"&gt;</code> within the
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
358 document itself, and defaults to <code>article</code>.</dd>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
359 </dl>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
360
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
361 <h3 id="processing-instructions">Processing instructions</h3>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
362 <p>Use the <code>&lt;?html2db?&gt;</code> processing instruction to
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
363 customize the transformation of the XHTML source to Docbook:</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
364
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
365 <table>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
366 <tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
367 <th>Processing instruction</th>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
368 <th>Content</th>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
369 <th>Effect</th>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
370 </tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
371
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
372 <tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
373 <td><code>&lt;?html2db class="<var>xxx</var>"?&gt;</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
374 <td><code>body</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
375 <td>Sets the output document root to <var>xxx</var>. Useful for
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
376 translating to <code>prefix</code>, <code>appendix</code>, or <code>chapter</code>; the default is
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
377 <var>$document-root</var>.</td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
378 </tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
379
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
380 <tr id="simplelist">
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
381 <td><code>&lt;?html2db class="simplelist"?&gt;</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
382 <td><code>ul</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
383 <td>Creates a vertical <code>simplelist</code>.<db:footnote><db:para>Note that the
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
384 current implementation simply checks for the presence of <em>any</em>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
385 <code>html2db</code> processing instruction.</db:para></db:footnote></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
386 </tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
387
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
388
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
389 <tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
390 <td><code>&lt;?html2db rowsep="1"?&gt;</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
391 <td><code>[informal]table</code></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
392 <td>Sets the <code>rowsep</code> attribute on the generated <code>table</code>.<db:footnote><db:para>Note that the current implementation simply checks for the presence of <em>any</em> <code>html2db</code> processing instruction that begins with <code>rowsep</code>, and assumes the vlaue is <code>1</code>.</db:para></db:footnote></td>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
393 </tr>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
394 </table>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
395
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
396 <h3 id="embedding">Overriding the built-in templates</h3>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
397 <p>For cases where the previous techniques don't allow for enough
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
398 customization, you can override the builtin templates. You will need
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
399 to know XSLT in order to do this, and you will need to write a new
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
400 stylesheet that uses the <code>xsl:import</code> element to import
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
401 <code>html2db.xsl</code>.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
402
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
403 <p>The <a href="examples.xsl"><code>example.xsl</code></a> stylesheet
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
404 is an example customization layer. It recognizes the <code>&lt;div
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
405 class="abstract"&gt;</code> and <code>&lt;p class="note"&gt;</code>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
406 classes in the <a href="index.src.html">source</a> for this document,
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
407 and generates the corresponding Docbook elements.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
408
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
409
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
410 <h2>FAQ</h2>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
411 <h3>Why generate Docbook?</h3>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
412 <p>The primary reason to use Docbook as an <em>output</em> format is
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
413 to take advantage of the Docbook XSL stylesheets. These are a
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
414 well-designed, well-documented set of XSL stylesheets that provide a
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
415 variety of publishing features that would be difficult to recreate
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
416 from scratch for HTML:</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
417
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
418 <ul>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
419 <li>Automatic Table-of-Contents generation</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
420 <li>Automatic part, chapter, and section numbering.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
421 <li>Creation of single-page, multi-page, PDF, and WinHelp files from the same source document.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
422 <li>Navigation headers, footers, and metadata for multi-page HTML
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
423 documents.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
424 <li>Link resolution and link target text insertion across multiple pages and numbered targets.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
425 <li>Figure, example, and table numbering, and tables of these.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
426 <li>Index and glossary tools.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
427 </ul>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
428
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
429 <h3>Why write in XHTML?</h3>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
430
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
431 <p>Given that Docbook is so great, why not write in it?</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
432
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
433 <p>Where there are not legacy concerns, Docbook is probably a better
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
434 choice for structured or technical documentation.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
435
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
436 <p>Where the only legacy concern is the documents themselves, and not
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
437 the tools and skill sets of documentation contributors, you should
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
438 consider using an (X)HMTL convertor to perform a one-time conversion
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
439 of your documentation source into Docbook, and then switching
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
440 development to the result files. You can use this stylesheet to
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
441 perform this conversion, or evaluate other tools, many of which are
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
442 probably appropriate for this purpose.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
443
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
444 <p>Often there are other legacy concerns: the availability of cheap
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
445 (including free) and usable HTML editors and editing modes; and the
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
446 fact that it's easier to teach people XHTML than Docbook. If either
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
447 of this is an issue in your organization, you may want to maintain
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
448 documentation sources in XHTML instead of Docbook</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
449
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
450 <p>For example, at <a href="http://www.laszlosystems.com/">Laszlo</a>,
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
451 most developers contribute directly to the documentation. Requiring
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
452 that developers learn Docbook, or that they wait on the doc team to
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
453 get content into the docs, would discourage this.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
454
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
455 <h3>Why not use an existing convertor?</h3>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
456
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
457 <p>This isn't the first (X)HTML to Docbook convertor. Why not use one
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
458 of the exisitng ones?</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
459
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
460 <p>Each HTML to Docbook convertors that I could find had at least some
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
461 of the following limitations, some of which stemmed from their
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
462 intended use as one-time-only convertors for legacy documents:</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
463
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
464 <ul>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
465 <li>Many only operated on a subset of HTML, and relied upon hand
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
466 editing of the output to clean up mistakes. This made them impossible
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
467 to use as part of a processing pipeline, where the source is
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
468 <em>maintained</em> in XHTML.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
469
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
470 <li>There was no way to customize the output, except by (1) hand
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
471 editing, or (2) writing a post-processing stylesheet, which didn't
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
472 have access to the information in the XHTML source document.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
473
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
474 <li>Many of them were difficult or impossible to customize and
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
475 extend. They were closed-source, or written in Java or Perl (which I
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
476 find to be a difficult languages to use for customizing this kind of
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
477 thing) and embedded in a larger system.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
478
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
479 <li>They didn't take full advantage of the Docbook tag set and content
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
480 model to represent document structure. For instance, they didn't
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
481 generate nested <code>section</code> elements to represent
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
482 <code>h1</code> <code>h2</code> sequences, or <code>table</code> to
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
483 represent tables with <code>summary</code> attributes.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
484 </ul>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
485
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
486 <h3>I got this error. What does it mean?</h3>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
487 <dl>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
488 <dt>Q. <code>Fatal Error! The element type "br" must be terminated by the matching end-tag "&lt;/br&gt;".
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
489 </code></dt>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
490 <dd>A. Your document is HTML, not <em>X</em>HTML. You need to fix it, or run it through Tidy first.</dd>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
491
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
492 <dt>Q. My output document is empty except for the <code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</code> line.</dt>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
493 <dd>A. The document is missing a namespace declaration. See the <a href="index.src.html">example</a> for an example.</dd>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
494
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
495 <dt>Q. Some of the headers and document sections are repeated multiple times.</dt>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
496 <dd>A. The document has out-of-sequence headers, such as <code>h1</code> followed by <code>h3</code> (instead of <code>h2</code>). This won't work.</dd>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
497
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
498 <dt>Q. <code>Fatal Error! The prefix "db" for element "db:footnote" is not bound.</code></dt>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
499 <dd>A. You haven't declared the <code>db</code> namespace prefix. See the <a href="index.src.html">example</a> for an example.</dd>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
500
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
501 </dl>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
502
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
503
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
504 <h2>Implementation Notes</h2>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
505
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
506 <h3>Bugs</h3>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
507 <ul>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
508 <li>Improperly sequenced <code>h<var>n</var></code> (for example
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
509 <code>h1</code> followed by <code>h3</code>, instead of
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
510 <code>h2</code>) will result in duplicate text.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
511 </ul>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
512
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
513
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
514 <h3>Limitations</h3>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
515 <ul>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
516 <li>The <code>id</code> attribute is only preserved for certain
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
517 elements (at least <code>h<var>n</var></code>, images, paragraphs, and
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
518 tables). It ought to be preserved for all of them.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
519 <li>Only the <a href="#tables">very simplest</a> table format is
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
520 implemented.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
521 <li>Always uses compact lists.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
522 <li>The string matching for <code>&lt;?html2b
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
523 class="<var>classname</var>"?&gt;</code> requires an exact match
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
524 (spaces and all).</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
525 <li>The <a href="#implicit-blocks">implicit blocks</a> code is easily
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
526 confused, as documented in that section. This is
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
527 easy to fix now that I understand the difference between block and
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
528 inline elements (I didn't when I was implementing this), but I
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
529 probably won't do so until I run into the problem again.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
530
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
531 </ul>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
532
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
533
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
534
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
535
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
536 <h3>Wishlist</h3>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
537 <ul>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
538 <li>Allow <code>&lt;html2db attribute-name="<var>name</var>"
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
539 value="<var>value</var>"?&gt;</code> at any position, to set arbitrary
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
540 Docbook attributes on the generated element.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
541
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
542 <li>Use different technique from the <a href="#docbook-elements">fake
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
543 namespace prefix</a> to name Docbook elements in the source, that
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
544 preserves the XHTML validity of the source file. For example, an
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
545 option transform <code>&lt;div class="db:footnote"&gt;</code> into
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
546 <code>&lt;footnote&gt;</code>, or to use a processing attribute
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
547 (<code>&lt;div&gt;&lt;?html2db classname="footnote"?&gt;</code>).</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
548
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
549 <li>Parse DC metadata from XHTML <code>html/head/meta</code>.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
550
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
551 <li>Add an option to use <code>html/head/title</code> instead of
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
552 <code>html/body/h1[1]</code> for top title.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
553
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
554 <li>Allow an <code>id</code> on every element.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
555
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
556 <li>Add an option to translate the XHTML <code>class</code> into a
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
557 Docbook <code>role</code>.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
558
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
559 <li>Preserve more of the whitespace from the source document &emdash; especially within lists and tables &emdash; in order to make it easier to debug the output document.</li>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
560
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
561 <h3>Support</h3>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
562 <p>This is a work in progress. It serves my needs, but doesn't
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
563 attempt to be much more general than that. If you run into anything
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
564 it can't handle, please send a note, or better yet, a patch, to <a
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
565 href="mailto:steele@osteele.com">steele@osteele.com</a>. I can't
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
566 promise to address problems (I have a day job too), but knowing what
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
567 people have run into will help my prioritize my work when I do have
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
568 time to work on this.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
569
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
570
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
571 </ul>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
572
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
573
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
574 <h3>Design Notes</h3>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
575 <h4 id="docbook-namespace">The Docbook Namespace</h4>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
576 <p>&html2db; accepts elements in the "Docbook namespace" in XHTML
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
577 source. This namespace is <code>urn:docbook</code>.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
578
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
579 <p>This isn't technically correct. Docbook doesn't really have a
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
580 namespace, and if it did, it wouldn't be this one. <a
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
581 href="http://www.faqs.org/rfcs/rfc3151.html">RFC 3151</a> suggests
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
582 <code>urn:publicid:-:OASIS:DTD+DocBook+XML+V4.1.2:EN</code> as the
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
583 Docbook namespace.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
584
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
585 <p>There two problems with the RFC 3151 namespace. First, it's long
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
586 and hard to remember. Second, it's limited to Docbook v4.1.2 &emdash;
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
587 but &html2db; works with other versions of Docbook too, which would
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
588 presumably have other namespaces. I think it's more useful to
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
589 <em>under</em>specify the Docbook version in the spec for this tool.
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
590 Docbook itself underspecifies the version completely, by avoiding a
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
591 namespace at all, but when mixing Docbook and XHTML elements I find it
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
592 useful to be <em>more</em> specific than that.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
593
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
594 <h3>History</h3>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
595 <p>The original version of &html2db; was written by <a
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
596 href="http://osteele.com">Oliver Steele</a>, as part of the <a
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
597 href="http://laszlosystems.com">Laszlo Systems, Inc.</a> documentation
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
598 effort. We had a set of custom stylesheets that formatted and added
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
599 linking information to programming-language elements such as
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
600 <code>classname</code> and <code>tagname</code>, and added
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
601 Table-of-Contents to chapter documentation and numbers examples.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
602
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
603 <p>As the documentation set grew, the doc team (John Sundman)
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
604 requested features such as inter-chapter navigation, callouts, and
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
605 index and glossary elements. I was able to beat all of these back
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
606 except for navigation, which seemed critical. After a few days trying
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
607 to implement this, I decided it would be simpler to convert the subset
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
608 of XHTML that we used into a subset of Docbook, and use the latter to
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
609 add navigation. (Once this was done, the other features came for
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
610 free.)</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
611
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
612 <p>During my August 2004 "sabbatical", I factored the general html2db
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
613 code out from the Laszlo-specific code, refactored and otherwise
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
614 cleaned it up, and wrote this documentation.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
615
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
616 <h3>Credits</h3>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
617 <p>&html2db; was written by <a href="http://osteele.com">Oliver Steele</a>, as part of the <a href="http://laszlosystems.com">Laszlo Systems, Inc.</a> documentation effort.</p>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
618
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
619 </body>
2ae81598b254 scripts for converting wiki documentation to docbook
nadvornik
parents:
diff changeset
620 </html>