*: Regenerate.
[gcc.git] / libstdc++-v3 / doc / html / manual / documentation_hacking.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Writing and Generating Documentation</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"><meta name="keywords" content="ISO C++, documentation, style, docbook, doxygen"><meta name="keywords" content="
2 ISO C++
3 ,
4 library
5 "><meta name="keywords" content="
6 ISO C++
7 ,
8 runtime
9 ,
10 library
11 "><link rel="home" href="../index.html" title="The GNU C++ Library"><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance"><link rel="prev" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance"><link rel="next" href="internals.html" title="Porting to New Hardware or Operating Systems"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Writing and Generating Documentation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="appendix_porting.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
12 Porting and Maintenance
13
14 </th><td width="20%" align="right"> <a accesskey="n" href="internals.html">Next</a></td></tr></table><hr></div><div class="section" title="Writing and Generating Documentation"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="appendix.porting.doc"></a>Writing and Generating Documentation</h2></div></div></div><div class="section" title="Introduction"><div class="titlepage"><div><div><h3 class="title"><a name="doc.intro"></a>Introduction</h3></div></div></div><p>
15 Documentation for the GNU C++ Library is created from three
16 independent sources: a manual, a FAQ, and an API reference.
17 </p><p>
18 The sub-directory <code class="filename">doc</code>
19 within the main source directory contains
20 <code class="filename">Makefile.am</code> and
21 <code class="filename">Makefile.in</code>, which provide rules for
22 generating documentation, described in excruciating detail
23 below. The <code class="filename">doc</code>
24 sub-directory also contains three directories: <code class="filename">doxygen</code>, which contains scripts and
25 fragments for <span class="command"><strong>doxygen</strong></span>, <code class="filename">html</code>, which contains an html
26 version of the manual, and <code class="filename">xml</code>, which contains an xml version
27 of the manual.
28 </p><p>
29 Diverging from established documentation conventions in the rest
30 of the GCC project, libstdc++ does not use Texinfo as a markup
31 language. Instead, Docbook is used to create the manual and the
32 FAQ, and Doxygen is used to construct the API
33 reference. Although divergent, this conforms to the GNU Project
34 recommendations as long as the output is of sufficient quality,
35 as per
36 <a class="link" href="http://www.gnu.org/prep/standards/standards.html#Documentation" target="_top">
37 GNU Manuals</a>.
38 </p></div><div class="section" title="Generating Documentation"><div class="titlepage"><div><div><h3 class="title"><a name="doc.generation"></a>Generating Documentation</h3></div></div></div><p>
39 Certain Makefile rules are required by the GNU Coding
40 Standards. These standard rules generate HTML, PDF, XML, or man
41 files. For each of the generative rules, there is an additional
42 install rule that is used to install any generated documentation
43 files into the prescribed installation directory. Files are
44 installed into <code class="filename">share/doc</code>
45 or <code class="filename">share/man</code> directories.
46 </p><p>
47 The standard Makefile rules are conditionally supported, based
48 on the results of examining the host environment for
49 prerequisites at configuration time. If requirements are not
50 found, the rule is aliased to a dummy rule that does nothing,
51 and produces no documentation. If the requirements are found,
52 the rule forwards to a private rule that produces the requested
53 documentation.
54 </p><p>
55 For more details on what prerequisites were found and where,
56 please consult the file <code class="filename">config.log</code> in the
57 libstdc++ build directory. Compare this log to what is expected
58 for the relevant Makefile conditionals:
59 <code class="literal">BUILD_INFO</code>, <code class="literal">BUILD_XML</code>,
60 <code class="literal">BUILD_HTML</code>, <code class="literal">BUILD_MAN</code>,
61 <code class="literal">BUILD_PDF</code>, and <code class="literal">BUILD_EPUB</code>.
62 </p><p>
63 Supported Makefile rules:
64 </p><div class="variablelist"><dl><dt><span class="term">
65 <span class="emphasis"><em>make html</em></span>
66 , </span><span class="term">
67 <span class="emphasis"><em>make install-html</em></span>
68 </span></dt><dd><p>
69 Generates multi-page HTML documentation, and installs it
70 in the following directories:
71 </p><p>
72 <code class="filename">
73 doc/libstdc++/libstdc++-api.html
74 </code>
75 </p><p>
76 <code class="filename">
77 doc/libstdc++/libstdc++-manual.html
78 </code>
79 </p></dd><dt><span class="term">
80 <span class="emphasis"><em>make pdf</em></span>
81 , </span><span class="term">
82 <span class="emphasis"><em>make install-pdf</em></span>
83 </span></dt><dd><p>
84 Generates indexed PDF documentation, and installs it as
85 the following files:
86 </p><p>
87 <code class="filename">doc/libstdc++/libstdc++-api.pdf</code>
88 </p><p>
89 <code class="filename">doc/libstdc++/libstdc++-manual.pdf</code>
90 </p></dd><dt><span class="term">
91 <span class="emphasis"><em>make man</em></span>
92 , </span><span class="term">
93 <span class="emphasis"><em>make install-man</em></span>
94 </span></dt><dd><p>
95 Generates man pages, and installs it in the following directory:
96 </p><p>
97 <code class="filename">man/man3/</code>
98 </p><p>
99 The generated man pages are namespace-qualified, so to look at
100 the man page for <code class="classname">vector</code>, one would use
101 <span class="command"><strong>man std::vector</strong></span>.
102 </p></dd><dt><span class="term">
103 <span class="emphasis"><em>make epub</em></span>
104 , </span><span class="term">
105 <span class="emphasis"><em>make install-epub</em></span>
106 </span></dt><dd><p>
107 Generates documentation in the ebook/portable electronic
108 reader format called Epub, and installs it as the
109 following file.
110 </p><p>
111 <code class="filename">doc/libstdc++/libstdc++-manual.epub</code>
112 </p></dd><dt><span class="term">
113 <span class="emphasis"><em>make xml</em></span>
114 , </span><span class="term">
115 <span class="emphasis"><em>make install-xml</em></span>
116 </span></dt><dd><p>
117 Generates single-file XML documentation, and installs it
118 as the following files:
119 </p><p>
120 <code class="filename">doc/libstdc++/libstdc++-api-single.xml</code>
121 </p><p>
122 <code class="filename">doc/libstdc++/libstdc++-manual-single.xml</code>
123 </p></dd></dl></div><p>
124 Makefile rules for several other formats are explicitly not
125 supported, and are always aliased to dummy rules. These
126 unsupported formats are: <span class="emphasis"><em>info</em></span>,
127 <span class="emphasis"><em>ps</em></span>, and <span class="emphasis"><em>dvi</em></span>.
128 </p></div><div class="section" title="Doxygen"><div class="titlepage"><div><div><h3 class="title"><a name="doc.doxygen"></a>Doxygen</h3></div></div></div><div class="section" title="Prerequisites"><div class="titlepage"><div><div><h4 class="title"><a name="doxygen.prereq"></a>Prerequisites</h4></div></div></div><div class="table"><a name="id678029"></a><p class="title"><b>Table B.1. Doxygen Prerequisites</b></p><div class="table-contents"><table summary="Doxygen Prerequisites" border="1"><colgroup><col align="center" class="c1"><col align="center" class="c2"><col align="center" class="c3"></colgroup><thead><tr><th align="center">Tool</th><th align="center">Version</th><th align="center">Required By</th></tr></thead><tbody><tr><td align="center">coreutils</td><td align="center">8.5</td><td align="center">all</td></tr><tr><td align="center">bash</td><td align="center">4.1</td><td align="center">all</td></tr><tr><td align="center">doxygen</td><td align="center">1.7.6.1</td><td align="center">all</td></tr><tr><td align="center">graphviz</td><td align="center">2.26</td><td align="center">graphical hierarchies</td></tr><tr><td align="center">pdflatex</td><td align="center">2007-59</td><td align="center">pdf output</td></tr></tbody></table></div></div><br class="table-break"><p>
129 Prerequisite tools are Bash 2.0 or later,
130 <a class="link" href="http://www.doxygen.org/" target="_top">Doxygen</a>, and
131 the <a class="link" href="http://www.gnu.org/software/coreutils/" target="_top">GNU
132 coreutils</a>. (GNU versions of find, xargs, and possibly
133 sed and grep are used, just because the GNU versions make
134 things very easy.)
135 </p><p>
136 To generate the pretty pictures and hierarchy
137 graphs, the
138 <a class="link" href="http://www.graphviz.org" target="_top">Graphviz</a> package
139 will need to be installed. For PDF
140 output, <a class="link" href="http://www.tug.org/applications/pdftex/" target="_top">
141 pdflatex</a> is required.
142 </p><p>
143 Be warned the PDF file generated via doxygen is extremely
144 large. At last count, the PDF file is over three thousand
145 pages. Generating this document taxes the underlying TeX
146 formatting system, and will require the expansion of TeX's memory
147 capacity. Specifically, the <code class="literal">pool_size</code>
148 variable in the configuration file <code class="filename">texmf.cnf</code> may
149 need to be increased by a minimum factor of two.
150 </p></div><div class="section" title="Generating the Doxygen Files"><div class="titlepage"><div><div><h4 class="title"><a name="doxygen.rules"></a>Generating the Doxygen Files</h4></div></div></div><p>
151 The following Makefile rules run Doxygen to generate HTML
152 docs, XML docs, XML docs as a single file, PDF docs, and the
153 man pages. These rules are not conditional! If the required
154 tools are not found, or are the wrong versions, the rule may
155 end in an error.
156 </p><p>
157 </p><pre class="screen"><strong class="userinput"><code>make doc-html-doxygen</code></strong></pre><p>
158 </p><p>
159 </p><pre class="screen"><strong class="userinput"><code>make doc-xml-doxygen</code></strong></pre><p>
160 </p><p>
161 </p><pre class="screen"><strong class="userinput"><code>make doc-xml-single-doxygen</code></strong></pre><p>
162 </p><p>
163 </p><pre class="screen"><strong class="userinput"><code>make doc-pdf-doxygen</code></strong></pre><p>
164 </p><p>
165 </p><pre class="screen"><strong class="userinput"><code>make doc-man-doxygen</code></strong></pre><p>
166 </p><p>
167 Generated files are output into separate sub directories of
168 <code class="filename">doc/doxygen/</code> in the
169 build directory, based on the output format. For instance, the
170 HTML docs will be in <code class="filename">doc/doxygen/html</code>.
171 </p><p>
172 Careful observers will see that the Makefile rules simply call
173 a script from the source tree, <code class="filename">run_doxygen</code>, which
174 does the actual work of running Doxygen and then (most
175 importantly) massaging the output files. If for some reason
176 you prefer to not go through the Makefile, you can call this
177 script directly. (Start by passing <code class="literal">--help</code>.)
178 </p><p>
179 If you wish to tweak the Doxygen settings, do so by editing
180 <code class="filename">doc/doxygen/user.cfg.in</code>. Notes to fellow
181 library hackers are written in triple-# comments.
182 </p></div><div class="section" title="Markup"><div class="titlepage"><div><div><h4 class="title"><a name="doxygen.markup"></a>Markup</h4></div></div></div><p>
183 In general, libstdc++ files should be formatted according to
184 the rules found in the
185 <a class="link" href="source_code_style.html" title="Coding Style">Coding Standard</a>. Before
186 any doxygen-specific formatting tweaks are made, please try to
187 make sure that the initial formatting is sound.
188 </p><p>
189 Adding Doxygen markup to a file (informally called
190 <span class="quote"><span class="quote">doxygenating</span></span>) is very simple. The Doxygen manual can be
191 found
192 <a class="link" href="http://www.stack.nl/~dimitri/doxygen/download.html#latestman" target="_top">here</a>.
193 We try to use a very-recent version of Doxygen.
194 </p><p>
195 For classes, use
196 <code class="classname">deque</code>/<code class="classname">vector</code>/<code class="classname">list</code>
197 and <code class="classname">std::pair</code> as examples. For
198 functions, see their member functions, and the free functions
199 in <code class="filename">stl_algobase.h</code>. Member functions of
200 other container-like types should read similarly to these
201 member functions.
202 </p><p>
203 Some commentary to accompany
204 the first list in the <a class="link" href="http://www.stack.nl/~dimitri/doxygen/docblocks.html" target="_top">Special
205 Documentation Blocks</a> section of
206 the Doxygen manual:
207 </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>For longer comments, use the Javadoc style...</p></li><li class="listitem"><p>
208 ...not the Qt style. The intermediate *'s are preferred.
209 </p></li><li class="listitem"><p>
210 Use the triple-slash style only for one-line comments (the
211 <span class="quote"><span class="quote">brief</span></span> mode).
212 </p></li><li class="listitem"><p>
213 This is disgusting. Don't do this.
214 </p></li></ol></div><p>
215 Some specific guidelines:
216 </p><p>
217 Use the @-style of commands, not the !-style. Please be
218 careful about whitespace in your markup comments. Most of the
219 time it doesn't matter; doxygen absorbs most whitespace, and
220 both HTML and *roff are agnostic about whitespace. However,
221 in &lt;pre&gt; blocks and @code/@endcode sections, spacing can
222 have <span class="quote"><span class="quote">interesting</span></span> effects.
223 </p><p>
224 Use either kind of grouping, as
225 appropriate. <code class="filename">doxygroups.cc</code> exists for this
226 purpose. See <code class="filename">stl_iterator.h</code> for a good example
227 of the <span class="quote"><span class="quote">other</span></span> kind of grouping.
228 </p><p>
229 Please use markup tags like @p and @a when referring to things
230 such as the names of function parameters. Use @e for emphasis
231 when necessary. Use @c to refer to other standard names.
232 (Examples of all these abound in the present code.)
233 </p><p>
234 Complicated math functions should use the multi-line
235 format. An example from <code class="filename">random.h</code>:
236 </p><p>
237 </p><div class="literallayout"><p><br>
238 /**<br>
239  * @brief A model of a linear congruential random number generator.<br>
240  *<br>
241  * @f[<br>
242  *     x_{i+1}\leftarrow(ax_{i} + c) \bmod m<br>
243  * @f]<br>
244  */<br>
245 </p></div><p>
246 </p><p>
247 One area of note is the markup required for
248 <code class="literal">@file</code> markup in header files. Two details
249 are important: for filenames that have the same name in
250 multiple directories, include part of the installed path to
251 disambiguate. For example:
252 </p><p>
253 </p><div class="literallayout"><p><br>
254 /** @file debug/vector<br>
255  *  This file is a GNU debug extension to the Standard C++ Library.<br>
256  */<br>
257 </p></div><p>
258 </p><p>
259 The other relevant detail for header files is the use of a
260 libstdc++-specific doxygen alias that helps distinguish
261 between public header files (like <code class="filename">random</code>)
262 from implementation or private header files (like
263 <code class="filename">bits/c++config.h</code>.) This alias is spelled
264 <code class="literal">@headername</code> and can take one or two
265 arguments that detail the public header file or files that
266 should be included to use the contents of the file. All header
267 files that are not intended for direct inclusion must use
268 <code class="literal">headername</code> in the <code class="literal">file</code>
269 block. An example:
270 </p><p>
271 </p><div class="literallayout"><p><br>
272 /** @file bits/basic_string.h<br>
273  *  This is an internal header file, included by other library headers.<br>
274  *  Do not attempt to use it directly. @headername{string}<br>
275  */<br>
276 </p></div><p>
277 </p><p>
278 Be careful about using certain, special characters when
279 writing Doxygen comments. Single and double quotes, and
280 separators in filenames are two common trouble spots. When in
281 doubt, consult the following table.
282 </p><div class="table"><a name="id678546"></a><p class="title"><b>Table B.2. HTML to Doxygen Markup Comparison</b></p><div class="table-contents"><table summary="HTML to Doxygen Markup Comparison" border="1"><colgroup><col align="left" class="c1"><col align="left" class="c2"></colgroup><thead><tr><th align="left">HTML</th><th align="left">Doxygen</th></tr></thead><tbody><tr><td align="left">\</td><td align="left">\\</td></tr><tr><td align="left">"</td><td align="left">\"</td></tr><tr><td align="left">'</td><td align="left">\'</td></tr><tr><td align="left">&lt;i&gt;</td><td align="left">@a word</td></tr><tr><td align="left">&lt;b&gt;</td><td align="left">@b word</td></tr><tr><td align="left">&lt;code&gt;</td><td align="left">@c word</td></tr><tr><td align="left">&lt;em&gt;</td><td align="left">@a word</td></tr><tr><td align="left">&lt;em&gt;</td><td align="left">&lt;em&gt;two words or more&lt;/em&gt;</td></tr></tbody></table></div></div><br class="table-break"></div></div><div class="section" title="Docbook"><div class="titlepage"><div><div><h3 class="title"><a name="doc.docbook"></a>Docbook</h3></div></div></div><div class="section" title="Prerequisites"><div class="titlepage"><div><div><h4 class="title"><a name="docbook.prereq"></a>Prerequisites</h4></div></div></div><div class="table"><a name="id678708"></a><p class="title"><b>Table B.3. Docbook Prerequisites</b></p><div class="table-contents"><table summary="Docbook Prerequisites" border="1"><colgroup><col align="center" class="c1"><col align="center" class="c2"><col align="center" class="c3"></colgroup><thead><tr><th align="center">Tool</th><th align="center">Version</th><th align="center">Required By</th></tr></thead><tbody><tr><td align="center">docbook5-style-xsl</td><td align="center">1.76.1</td><td align="center">all</td></tr><tr><td align="center">xsltproc</td><td align="center">1.1.26</td><td align="center">all</td></tr><tr><td align="center">xmllint</td><td align="center">2.7.7</td><td align="center">validation</td></tr><tr><td align="center">dblatex</td><td align="center">0.3</td><td align="center">pdf output</td></tr><tr><td align="center">pdflatex</td><td align="center">2007-59</td><td align="center">pdf output</td></tr><tr><td align="center">docbook2X</td><td align="center">0.8.8</td><td align="center">info output</td></tr><tr><td align="center">epub3 stylesheets</td><td align="center">b3</td><td align="center">epub output</td></tr></tbody></table></div></div><br class="table-break"><p>
283 Editing the DocBook sources requires an XML editor. Many
284 exist: some notable options
285 include <span class="command"><strong>emacs</strong></span>, <span class="application">Kate</span>,
286 or <span class="application">Conglomerate</span>.
287 </p><p>
288 Some editors support special <span class="quote"><span class="quote">XML Validation</span></span>
289 modes that can validate the file as it is
290 produced. Recommended is the <span class="command"><strong>nXML Mode</strong></span>
291 for <span class="command"><strong>emacs</strong></span>.
292 </p><p>
293 Besides an editor, additional DocBook files and XML tools are
294 also required.
295 </p><p>
296 Access to the DocBook 5.0 stylesheets and schema is required. The
297 stylesheets are usually packaged by vendor, in something
298 like <code class="filename">docbook5-style-xsl</code>. To exactly match
299 generated output, please use a version of the stylesheets
300 equivalent
301 to <code class="filename">docbook5-style-xsl-1.75.2-3</code>. The
302 installation directory for this package corresponds to
303 the <code class="literal">XSL_STYLE_DIR</code>
304 in <code class="filename">doc/Makefile.am</code> and defaults
305 to <code class="filename">/usr/share/sgml/docbook/xsl-ns-stylesheets</code>.
306 </p><p>
307 For processing XML, an XSLT processor and some style
308 sheets are necessary. Defaults are <span class="command"><strong>xsltproc</strong></span>
309 provided by <code class="filename">libxslt</code>.
310 </p><p>
311 For validating the XML document, you'll need
312 something like <span class="command"><strong>xmllint</strong></span> and access to the
313 relevant DocBook schema. These are provided
314 by a vendor package like <code class="filename">libxml2</code> and <code class="filename">docbook5-schemas-5.0-4</code>
315 </p><p>
316 For PDF output, something that transforms valid Docbook XML to PDF is
317 required. Possible solutions include <a class="link" href="http://dblatex.sourceforge.net" target="_top">dblatex</a>,
318 <span class="command"><strong>xmlto</strong></span>, or <span class="command"><strong>prince</strong></span>. Of
319 these, <span class="command"><strong>dblatex</strong></span> is the default. Other
320 options are listed on the DocBook web <a class="link" href="http://wiki.docbook.org/topic/DocBookPublishingTools" target="_top">pages</a>. Please
321 consult the <code class="email">&lt;<a class="email" href="mailto:libstdc++@gcc.gnu.org">libstdc++@gcc.gnu.org</a>&gt;</code> list when
322 preparing printed manuals for current best practice and
323 suggestions.
324 </p><p>
325 For Texinfo output, something that transforms valid Docbook
326 XML to Texinfo is required. The default choice is <a class="link" href="http://docbook2x.sourceforge.net/" target="_top">docbook2X</a>.
327 </p><p>
328 For epub output, the <a class="link" href="http://sourceforge.net/projects/docbook/files/epub3/" target="_top">stylesheets</a> for EPUB3 are required. These stylesheets are still in development. To validate the created file, <a class="link" href="https://code.google.com/p/epubcheck/" target="_top">epubcheck</a> is necessary.
329 </p></div><div class="section" title="Generating the DocBook Files"><div class="titlepage"><div><div><h4 class="title"><a name="docbook.rules"></a>Generating the DocBook Files</h4></div></div></div><p>
330 The following Makefile rules generate (in order): an HTML
331 version of all the DocBook documentation, a PDF version of the
332 same, and a single XML document. These rules are not
333 conditional! If the required tools are not found, or are the
334 wrong versions, the rule may end in an error.
335 </p><p>
336 </p><pre class="screen"><strong class="userinput"><code>make doc-html-docbook</code></strong></pre><p>
337 </p><p>
338 </p><pre class="screen"><strong class="userinput"><code>make doc-pdf-docbook</code></strong></pre><p>
339 </p><p>
340 </p><pre class="screen"><strong class="userinput"><code>make doc-xml-single-docbook</code></strong></pre><p>
341 </p><p>
342 Generated files are output into separate sub directores of
343 <code class="filename">doc/docbook/</code> in the
344 build directory, based on the output format. For instance, the
345 HTML docs will be in <code class="filename">doc/docbook/html</code>.
346 </p><p>
347 If the Docbook stylesheets are installed in a custom location,
348 one can use the variable <code class="literal">XSL_STYLE_DIR</code> to
349 override the Makefile defaults. For example:
350 </p><pre class="screen">
351 <strong class="userinput"><code>
352 make <code class="literal">XSL_STYLE_DIR="/usr/share/xml/docbook/stylesheet/nwalsh"</code> doc-html-docbook
353 </code></strong>
354 </pre></div><div class="section" title="Editing and Validation"><div class="titlepage"><div><div><h4 class="title"><a name="docbook.validation"></a>Editing and Validation</h4></div></div></div><p>
355 After editing the xml sources, please make sure that the XML
356 documentation and markup is still valid. This can be
357 done easily, with the following validation rule:
358 </p><pre class="screen">
359 <strong class="userinput"><code>make doc-xml-validate-docbook</code></strong>
360 </pre><p>
361 This is equivalent to doing:
362 </p><pre class="screen">
363 <strong class="userinput"><code>
364 xmllint --noout --valid <code class="filename">xml/index.xml</code>
365 </code></strong>
366 </pre><p>
367 Please note that individual sections and chapters of the
368 manual can be validated by substituting the file desired for
369 <code class="filename">xml/index.xml</code> in the command
370 above. Reducing scope in this manner can be helpful when
371 validation on the entire manual fails.
372 </p><p>
373 All Docbook xml sources should always validate. No excuses!
374 </p></div><div class="section" title="File Organization and Basics"><div class="titlepage"><div><div><h4 class="title"><a name="docbook.examples"></a>File Organization and Basics</h4></div></div></div><div class="literallayout"><p><br>
375       <span class="emphasis"><em>Which files are important</em></span><br>
376 <br>
377       All Docbook files are in the directory<br>
378       libstdc++-v3/doc/xml<br>
379 <br>
380       Inside this directory, the files of importance:<br>
381       spine.xml   - index to documentation set<br>
382       manual/spine.xml  - index to manual<br>
383       manual/*.xml   - individual chapters and sections of the manual<br>
384       faq.xml   - index to FAQ<br>
385       api.xml   - index to source level / API<br>
386 <br>
387       All *.txml files are template xml files, i.e., otherwise empty files with<br>
388       the correct structure, suitable for filling in with new information.<br>
389 <br>
390       <span class="emphasis"><em>Canonical Writing Style</em></span><br>
391 <br>
392       class template<br>
393       function template<br>
394       member function template<br>
395       (via C++ Templates, Vandevoorde)<br>
396 <br>
397       class in namespace std: allocator, not std::allocator<br>
398 <br>
399       header file: iostream, not &lt;iostream&gt;<br>
400 <br>
401 <br>
402       <span class="emphasis"><em>General structure</em></span><br>
403 <br>
404       &lt;set&gt;<br>
405       &lt;book&gt;<br>
406       &lt;/book&gt;<br>
407 <br>
408       &lt;book&gt;<br>
409       &lt;chapter&gt;<br>
410       &lt;/chapter&gt;<br>
411       &lt;/book&gt;<br>
412 <br>
413       &lt;book&gt;<br>
414       &lt;part&gt;<br>
415       &lt;chapter&gt;<br>
416       &lt;section&gt;<br>
417       &lt;/section&gt;<br>
418 <br>
419       &lt;sect1&gt;<br>
420       &lt;/sect1&gt;<br>
421 <br>
422       &lt;sect1&gt;<br>
423       &lt;sect2&gt;<br>
424       &lt;/sect2&gt;<br>
425       &lt;/sect1&gt;<br>
426       &lt;/chapter&gt;<br>
427 <br>
428       &lt;chapter&gt;<br>
429       &lt;/chapter&gt;<br>
430       &lt;/part&gt;<br>
431       &lt;/book&gt;<br>
432 <br>
433       &lt;/set&gt;<br>
434     </p></div></div><div class="section" title="Markup By Example"><div class="titlepage"><div><div><h4 class="title"><a name="docbook.markup"></a>Markup By Example</h4></div></div></div><p>
435 Complete details on Docbook markup can be found in the DocBook
436 Element Reference,
437 <a class="link" href="http://www.docbook.org/tdg/en/html/part2.html" target="_top">online</a>.
438 An incomplete reference for HTML to Docbook conversion is
439 detailed in the table below.
440 </p><div class="table"><a name="id679219"></a><p class="title"><b>Table B.4. HTML to Docbook XML Markup Comparison</b></p><div class="table-contents"><table summary="HTML to Docbook XML Markup Comparison" border="1"><colgroup><col align="left" class="c1"><col align="left" class="c2"></colgroup><thead><tr><th align="left">HTML</th><th align="left">Docbook</th></tr></thead><tbody><tr><td align="left">&lt;p&gt;</td><td align="left">&lt;para&gt;</td></tr><tr><td align="left">&lt;pre&gt;</td><td align="left">&lt;computeroutput&gt;, &lt;programlisting&gt;,
441 &lt;literallayout&gt;</td></tr><tr><td align="left">&lt;ul&gt;</td><td align="left">&lt;itemizedlist&gt;</td></tr><tr><td align="left">&lt;ol&gt;</td><td align="left">&lt;orderedlist&gt;</td></tr><tr><td align="left">&lt;il&gt;</td><td align="left">&lt;listitem&gt;</td></tr><tr><td align="left">&lt;dl&gt;</td><td align="left">&lt;variablelist&gt;</td></tr><tr><td align="left">&lt;dt&gt;</td><td align="left">&lt;term&gt;</td></tr><tr><td align="left">&lt;dd&gt;</td><td align="left">&lt;listitem&gt;</td></tr><tr><td align="left">&lt;a href=""&gt;</td><td align="left">&lt;ulink url=""&gt;</td></tr><tr><td align="left">&lt;code&gt;</td><td align="left">&lt;literal&gt;, &lt;programlisting&gt;</td></tr><tr><td align="left">&lt;strong&gt;</td><td align="left">&lt;emphasis&gt;</td></tr><tr><td align="left">&lt;em&gt;</td><td align="left">&lt;emphasis&gt;</td></tr><tr><td align="left">"</td><td align="left">&lt;quote&gt;</td></tr></tbody></table></div></div><br class="table-break"><p>
442 And examples of detailed markup for which there are no real HTML
443 equivalents are listed in the table below.
444 </p><div class="table"><a name="id679421"></a><p class="title"><b>Table B.5. Docbook XML Element Use</b></p><div class="table-contents"><table summary="Docbook XML Element Use" border="1"><colgroup><col align="left" class="c1"><col align="left" class="c2"></colgroup><thead><tr><th align="left">Element</th><th align="left">Use</th></tr></thead><tbody><tr><td align="left">&lt;structname&gt;</td><td align="left">&lt;structname&gt;char_traits&lt;/structname&gt;</td></tr><tr><td align="left">&lt;classname&gt;</td><td align="left">&lt;classname&gt;string&lt;/classname&gt;</td></tr><tr><td align="left">&lt;function&gt;</td><td align="left">
445 <p>&lt;function&gt;clear()&lt;/function&gt;</p>
446 <p>&lt;function&gt;fs.clear()&lt;/function&gt;</p>
447 </td></tr><tr><td align="left">&lt;type&gt;</td><td align="left">&lt;type&gt;long long&lt;/type&gt;</td></tr><tr><td align="left">&lt;varname&gt;</td><td align="left">&lt;varname&gt;fs&lt;/varname&gt;</td></tr><tr><td align="left">&lt;literal&gt;</td><td align="left">
448 <p>&lt;literal&gt;-Weffc++&lt;/literal&gt;</p>
449 <p>&lt;literal&gt;rel_ops&lt;/literal&gt;</p>
450 </td></tr><tr><td align="left">&lt;constant&gt;</td><td align="left">
451 <p>&lt;constant&gt;_GNU_SOURCE&lt;/constant&gt;</p>
452 <p>&lt;constant&gt;3.0&lt;/constant&gt;</p>
453 </td></tr><tr><td align="left">&lt;command&gt;</td><td align="left">&lt;command&gt;g++&lt;/command&gt;</td></tr><tr><td align="left">&lt;errortext&gt;</td><td align="left">&lt;errortext&gt;In instantiation of&lt;/errortext&gt;</td></tr><tr><td align="left">&lt;filename&gt;</td><td align="left">
454 <p>&lt;filename class="headerfile"&gt;ctype.h&lt;/filename&gt;</p>
455 <p>&lt;filename class="directory"&gt;/home/gcc/build&lt;/filename&gt;</p>
456 <p>&lt;filename class="libraryfile"&gt;libstdc++.so&lt;/filename&gt;</p>
457 </td></tr></tbody></table></div></div><br class="table-break"></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="appendix_porting.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="appendix_porting.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="internals.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix B. 
458 Porting and Maintenance
459
460  </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Porting to New Hardware or Operating Systems</td></tr></table></div></body></html>