boostbook.getting.started.html 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Getting Started</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.61.3"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="boostbook.html" title="The BoostBook Documentation Format"><link rel="previous" href="boostbook.html" title="The BoostBook Documentation Format"><link rel="next" href="boostbook.documenting.html" title="Documenting libraries"><link rel="chapter" href="libraries.html" title="The Boost C++ Libraries"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2383300-bb.html" title="Function any_cast"><link rel="chapter" href="array.html" title="Boost.Array"><link rel="refentry" href="class.boost.array.html" title="Class template array"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="class.boost.bad_function_call.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="class.boost.reference_wrapper.html" title="Class template reference_wrapper"><link rel="refentry" href="class.boost.is_reference_wrapper.html" title="Class template is_reference_wrapper"><link rel="refentry" href="class.boost.unwrap_reference.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="class.boost.signals.trackable.html" title="Class trackable"><link rel="refentry" href="class.boost.signals.connection.html" title="Class connection"><link rel="refentry" href="class.boost.signals.scoped_connection.html" title="Class scoped_connection"><link rel="refentry" href="id2532119-bb.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2354683-bb.html" title="Class last_value&lt;void&gt;"><link rel="chapter" href="variant.html" title="Boost.Variant"><link rel="refentry" href="BOOST_VARIANT_LIMIT_TYPES.html" title="Macro BOOST_VARIANT_LIMIT_TYPES"><link rel="refentry" href="BOOST_VARIANT_ENUM_PARAMS.html" title="Macro BOOST_VARIANT_ENUM_PARAMS"><link rel="refentry" href="BOOST_VARIANT_ENUM_SHIFTED_PARAMS.html" title="Macro BOOST_VARIANT_ENUM_SHIFTED_PARAMS"><link rel="refentry" href="BOOST_VARIANT_NO_REFERENCE_SUPPORT.html" title="Macro BOOST_VARIANT_NO_REFERENCE_SUPPORT"><link rel="refentry" href="BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT.html" title="Macro BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT"><link rel="refentry" href="BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT.html" title="Macro BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT"><link rel="refentry" href="class.boost.variant.html" title="Class template variant"><link rel="refentry" href="id2518553-bb.html" title="Function template swap"><link rel="refentry" href="id2524211-bb.html" title="Function template operator&lt;&lt;"><link rel="refentry" href="class.boost.make_variant_over.html" title="Class template make_variant_over"><link rel="refentry" href="class.boost.make_recursive_variant.html" title="Class template make_recursive_variant"><link rel="refentry" href="class.boost.make_recursive_variant_over.html" title="Class template make_recursive_variant_over"><link rel="refentry" href="class.boost.recursive_wrapper.html" title="Class template recursive_wrapper"><link rel="refentry" href="class.boost.is_recursive_wrapper.html" title="Class template is_recursive_wrapper"><link rel="refentry" href="class.boost.unwrap_recursive_wrapper.html" title="Class template unwrap_recursive_wrapper"><link rel="refentry" href="class.boost.apply_visitor_delayed_t.html" title="Class template apply_visitor_delayed_t"><link rel="refentry" href="id2557051-bb.html" title="Function apply_visitor"><link rel="refentry" href="class.boost.bad_get.html" title="Class bad_get"><link rel="refentry" href="id2493238-bb.html" title="Function get"><link rel="refentry" href="class.boost.bad_visit.html" title="Class bad_visit"><link rel="refentry" href="class.boost.static_visitor.html" title="Class template static_visitor"><link rel="refentry" href="class.boost.visitor_ptr_t.html" title="Class template visitor_ptr_t"><link rel="refentry" href="id2544445-bb.html" title="Function template visitor_ptr"><link rel="chapter" href="boostbook.html" title="The BoostBook Documentation Format"><link rel="refentry" href="boostbook.dtd.class-specialization.html" title="
  2. BoostBook element class-specialization"><link rel="refentry" href="boostbook.dtd.link-test.html" title="
  3. BoostBook element link-test"><link rel="refentry" href="boostbook.dtd.link-fail-test.html" title="
  4. BoostBook element link-fail-test"><link rel="refentry" href="boostbook.dtd.typedef.html" title="
  5. BoostBook element typedef"><link rel="refentry" href="boostbook.dtd.static-constant.html" title="
  6. BoostBook element static-constant"><link rel="refentry" href="boostbook.dtd.code.html" title="
  7. BoostBook element code"><link rel="refentry" href="boostbook.dtd.destructor.html" title="
  8. BoostBook element destructor"><link rel="refentry" href="boostbook.dtd.template-type-parameter.html" title="
  9. BoostBook element template-type-parameter"><link rel="refentry" href="boostbook.dtd.description.html" title="
  10. BoostBook element description"><link rel="refentry" href="boostbook.dtd.librarylist.html" title="
  11. BoostBook element librarylist"><link rel="refentry" href="boostbook.dtd.library-reference.html" title="
  12. BoostBook element library-reference"><link rel="refentry" href="boostbook.dtd.boostbook.html" title="
  13. BoostBook element boostbook"><link rel="refentry" href="boostbook.dtd.union.html" title="
  14. BoostBook element union"><link rel="refentry" href="boostbook.dtd.inherit.html" title="
  15. BoostBook element inherit"><link rel="refentry" href="boostbook.dtd.template-varargs.html" title="
  16. BoostBook element template-varargs"><link rel="refentry" href="boostbook.dtd.source.html" title="
  17. BoostBook element source"><link rel="refentry" href="boostbook.dtd.function.html" title="
  18. BoostBook element function"><link rel="refentry" href="boostbook.dtd.postconditions.html" title="
  19. BoostBook element postconditions"><link rel="refentry" href="boostbook.dtd.compile-test.html" title="
  20. BoostBook element compile-test"><link rel="refentry" href="boostbook.dtd.method.html" title="
  21. BoostBook element method"><link rel="refentry" href="boostbook.dtd.snippet.html" title="
  22. BoostBook element snippet"><link rel="refentry" href="boostbook.dtd.constructor.html" title="
  23. BoostBook element constructor"><link rel="refentry" href="boostbook.dtd.namespace.html" title="
  24. BoostBook element namespace"><link rel="refentry" href="boostbook.dtd.if-fails.html" title="
  25. BoostBook element if-fails"><link rel="refentry" href="boostbook.dtd.free-function-group.html" title="
  26. BoostBook element free-function-group"><link rel="refentry" href="boostbook.dtd.functionname.html" title="
  27. BoostBook element functionname"><link rel="refentry" href="boostbook.dtd.librarycategory.html" title="
  28. BoostBook element librarycategory"><link rel="refentry" href="boostbook.dtd.notes.html" title="
  29. BoostBook element notes"><link rel="refentry" href="boostbook.dtd.data-member.html" title="
  30. BoostBook element data-member"><link rel="refentry" href="boostbook.dtd.specialization.html" title="
  31. BoostBook element specialization"><link rel="refentry" href="boostbook.dtd.union-specialization.html" title="
  32. BoostBook element union-specialization"><link rel="refentry" href="boostbook.dtd.throws.html" title="
  33. BoostBook element throws"><link rel="refentry" href="boostbook.dtd.template-arg.html" title="
  34. BoostBook element template-arg"><link rel="refentry" href="boostbook.dtd.method-group.html" title="
  35. BoostBook element method-group"><link rel="refentry" href="boostbook.dtd.requirement.html" title="
  36. BoostBook element requirement"><link rel="refentry" href="boostbook.dtd.precondition.html" title="
  37. BoostBook element precondition"><link rel="refentry" href="boostbook.dtd.paramtype.html" title="
  38. BoostBook element paramtype"><link rel="refentry" href="boostbook.dtd.using-class.html" title="
  39. BoostBook element using-class"><link rel="refentry" href="boostbook.dtd.run-test.html" title="
  40. BoostBook element run-test"><link rel="refentry" href="boostbook.dtd.librarypurpose.html" title="
  41. BoostBook element librarypurpose"><link rel="refentry" href="boostbook.dtd.copy-assignment.html" title="
  42. BoostBook element copy-assignment"><link rel="refentry" href="boostbook.dtd.run-fail-test.html" title="
  43. BoostBook element run-fail-test"><link rel="refentry" href="boostbook.dtd.template.html" title="
  44. BoostBook element template"><link rel="refentry" href="boostbook.dtd.compile-fail-test.html" title="
  45. BoostBook element compile-fail-test"><link rel="refentry" href="boostbook.dtd.returns.html" title="
  46. BoostBook element returns"><link rel="refentry" href="boostbook.dtd.default.html" title="
  47. BoostBook element default"><link rel="refentry" href="boostbook.dtd.parameter.html" title="
  48. BoostBook element parameter"><link rel="refentry" href="boostbook.dtd.signature.html" title="
  49. BoostBook element signature"><link rel="refentry" href="boostbook.dtd.overloaded-function.html" title="
  50. BoostBook element overloaded-function"><link rel="refentry" href="boostbook.dtd.class.html" title="
  51. BoostBook element class"><link rel="refentry" href="boostbook.dtd.librarycategorydef.html" title="
  52. BoostBook element librarycategorydef"><link rel="refentry" href="boostbook.dtd.type.html" title="
  53. BoostBook element type"><link rel="refentry" href="boostbook.dtd.enumvalue.html" title="
  54. BoostBook element enumvalue"><link rel="refentry" href="boostbook.dtd.overloaded-method.html" title="
  55. BoostBook element overloaded-method"><link rel="refentry" href="boostbook.dtd.programlisting.html" title="
  56. BoostBook element programlisting"><link rel="refentry" href="boostbook.dtd.complexity.html" title="
  57. BoostBook element complexity"><link rel="refentry" href="boostbook.dtd.purpose.html" title="
  58. BoostBook element purpose"><link rel="refentry" href="boostbook.dtd.template-nontype-parameter.html" title="
  59. BoostBook element template-nontype-parameter"><link rel="refentry" href="boostbook.dtd.library.html" title="
  60. BoostBook element library"><link rel="refentry" href="boostbook.dtd.librarycategorylist.html" title="
  61. BoostBook element librarycategorylist"><link rel="refentry" href="boostbook.dtd.using-namespace.html" title="
  62. BoostBook element using-namespace"><link rel="refentry" href="boostbook.dtd.struct-specialization.html" title="
  63. BoostBook element struct-specialization"><link rel="refentry" href="boostbook.dtd.struct.html" title="
  64. BoostBook element struct"><link rel="refentry" href="boostbook.dtd.lib.html" title="
  65. BoostBook element lib"><link rel="refentry" href="boostbook.dtd.enum.html" title="
  66. BoostBook element enum"><link rel="refentry" href="boostbook.dtd.requires.html" title="
  67. BoostBook element requires"><link rel="refentry" href="boostbook.dtd.effects.html" title="
  68. BoostBook element effects"><link rel="refentry" href="boostbook.dtd.libraryname.html" title="
  69. BoostBook element libraryname"><link rel="refentry" href="boostbook.dtd.libraryinfo.html" title="
  70. BoostBook element libraryinfo"><link rel="refentry" href="boostbook.dtd.testsuite.html" title="
  71. BoostBook element testsuite"><link rel="refentry" href="boostbook.dtd.header.html" title="
  72. BoostBook element header"><link rel="refentry" href="boostbook.dtd.rationale.html" title="
  73. BoostBook element rationale"><link rel="refentry" href="Assignable.html" title="Concept Assignable"><link rel="refentry" href="InputIterator.html" title="Concept InputIterator"><link rel="refentry" href="OutputIterator.html" title="Concept OutputIterator"><link rel="refentry" href="ForwardIterator.html" title="Concept ForwardIterator"><link rel="refentry" href="BidirectionalIterator.html" title="Concept BidirectionalIterator"><link rel="refentry" href="RandomAccessIterator.html" title="Concept RandomAccessIterator"><link rel="refentry" href="DefaultConstructible.html" title="Concept DefaultConstructible"><link rel="refentry" href="CopyConstructible.html" title="Concept CopyConstructible"><link rel="refentry" href="EqualityComparable.html" title="Concept EqualityComparable"><link rel="refentry" href="LessThanComparable.html" title="Concept LessThanComparable"><link rel="refentry" href="SignedInteger.html" title="Concept SignedInteger"><link rel="subsection" href="boostbook.getting.started.html#boostbook.docbook.config" title="Configuring local DocBook XSL and DTD distributions"><link rel="subsection" href="boostbook.getting.started.html#boostbook.fop" title="Configuring Apache FOP for PostScript/PDF Output"><link rel="subsection" href="boostbook.getting.started.html#boostbook.doxygen" title="Configuring Doxygen for Documentation Extraction"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c++boost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="libraries.html"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="boostbook.getting.started"></a>Getting Started</h3></div></div><div></div></div><div class="toc"><dl><dt><a href="boostbook.getting.started.html#boostbook.docbook.config">Configuring local DocBook XSL and DTD distributions</a></dt><dt><a href="boostbook.getting.started.html#boostbook.fop">Configuring Apache FOP for PostScript/PDF Output</a></dt><dt><a href="boostbook.getting.started.html#boostbook.doxygen">Configuring Doxygen for Documentation Extraction</a></dt></dl></div><p>To use the Boost documentation tools, you will need an
  74. <a href="http://www.w3c.org/Style/XSL/" target="_top">XSLT</a>
  75. processor. There are many XSLT processors available, but for now
  76. we suggest that you use <tt class="computeroutput">xsltproc</tt>, part of <a href="http://xmlsoft.org/XSLT/" target="_top">libxslt</a>. There are several
  77. ways to get libxslt, depending on your platform:</p><div class="itemizedlist"><ul type="disc"><li><p>On Unix: Build and install <a href="http://xmlsoft.org/" target="_top">libxml2</a> and then <a href="http://xmlsoft.org/XSLT/" target="_top">libxslt</a>. Both
  78. libraries are part of the <a href="http://www.gnome.org" target="_top">GNOME</a> project.</p></li><li><p>On Windows:</p><div class="itemizedlist"><ul type="circle"><li><p>With <a href="http://www.cygwin.com/" target="_top">Cygwin</a>, select the
  79. libxml2 and libxslt packages</p></li><li><p>Without Cygwin, you can at <a href="http://www.zlatkovic.com/projects/libxml/binaries.html" target="_top">download
  80. the libxml2, libxslt, and iconv binaries</a>. Or, use
  81. my <a href="http://www.cs.rpi.edu/~gregod/boost/doc/xsltproc-win32.zip" target="_top">minimal
  82. repackaged version</a>.</p></li></ul></div></li></ul></div><p>You will also need a recent checkout of Boost from <a href="http://www.boost.org/more/download.html#CVS" target="_top">CVS</a>. If
  83. you would like to limit your network bandwidth or limit delays in
  84. building documentation, now might be a good time to download the
  85. DocBook DTD and XSL stylesheets as described in <a href="boostbook.getting.started.html#boostbook.docbook.config" title="Configuring local DocBook XSL and DTD distributions">the section called &#8220;Configuring local DocBook XSL and DTD distributions&#8221;</a>.</p><p>Now we can build some documentation. Change to the directory
  86. <tt class="computeroutput">$BOOST_ROOT/doc</tt> and run <tt class="computeroutput">bjam --v2</tt> to
  87. build HTML documentation. You should see several warnings like
  88. these while DocBook documentation is being built from BoostBook
  89. documentation:</p><pre class="programlisting">Cannot find function named 'checked_delete'
  90. Cannot find function named 'checked_array_delete'
  91. Cannot find function named 'next'</pre><p>These warnings are emitted when the Boost documentation
  92. tools cannot find documentation for functions, methods, or classes
  93. that are referenced in the source, and are not harmful in any
  94. way. Once Boost.Jam has completed its execution, HTML
  95. documentation for Boost will be available in
  96. <tt class="computeroutput">$BOOST_ROOT/doc/html</tt>. You can also create HTML
  97. documentation in a single (large!) HTML file with the command line
  98. <tt class="computeroutput">bjam --v2 onehtml</tt>, or Unix man pages with the command
  99. line <tt class="computeroutput">bjam --v2 man</tt>. The complete list of output
  100. formats is listed in <a href="boostbook.getting.started.html#boostbook.output.formats" title="Table 1. BoostBook Output Formats">Table 1</a>. Several output formats can
  101. be passed to a single invocation of <tt class="computeroutput">bjam</tt>, e.g.,
  102. <tt class="computeroutput">bjam --v2 html man docbook</tt> would generate HTML
  103. (multiple files), man pages, and DocBook documentation.</p><div class="table"><a name="boostbook.output.formats"></a><p class="title"><b>Table 1. BoostBook Output Formats</b></p><table summary="BoostBook Output Formats" border="1"><colgroup><col><col></colgroup><thead><tr><th>Format</th><th>Description</th></tr></thead><tbody><tr><td>html</td><td><p>HTML output (multiple files). This is the default</p></td></tr><tr><td>onehtml</td><td><p>HTML output in a single HTML file.</p></td></tr><tr><td>man</td><td><p>Unix man pages.</p></td></tr><tr><td>pdf</td><td><p>PDF. Requires <a href="http://xml.apache.org/fop/index.html" target="_top">Apache FOP</a>.</p></td></tr><tr><td>ps</td><td><p>Postscript. Requires <a href="http://xml.apache.org/fop/index.html" target="_top">Apache FOP</a>.</p></td></tr><tr><td>docbook</td><td><a href="http://www.docbook.org/" target="_top">DocBook</a>.</td></tr><tr><td>fo</td><td><a href="http://www.w3.org/TR/xsl/" target="_top">XSL Formatting Objects</a></td></tr></tbody></table></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="boostbook.docbook.config"></a>Configuring local DocBook XSL and DTD distributions</h4></div></div><div></div></div><p>By default, the DocBook DTD and XSL stylesheets are
  104. accessed over a network automatically by the XSLT
  105. processor. However, these documents tend to be large and
  106. introduce a noticeable delay in the XSLT transformation
  107. step. This section describes how to configure Boost.Build to use
  108. local copies of the DocBook DTD and XSL stylesheets to improve
  109. processing time. There are a few requirements:
  110. </p><div class="itemizedlist"><ul type="disc"><li><p>Norman Walsh's DocBook XSL stylesheets,
  111. available at the <a href="http://docbook.sourceforge.net" target="_top">DocBook sourceforge
  112. site</a>. Extract the DocBook XSL stylesheets to a
  113. directory on your hard disk (which we'll refer to as the
  114. <tt class="computeroutput">DOCBOOK_XSL_DIR</tt>).</p></li><li><p>The DocBook DTD, available as a ZIP archive at
  115. the <a href="http://www.oasis-open.org/docbook/xml/4.2/index.shtml" target="_top">OASIS
  116. DocBook site</a>. The package is called "DocBook XML
  117. 4.2". Extract the DocBook DTD to a directory on your hard disk
  118. (which we'll refer to as the
  119. <tt class="computeroutput">DOCBOOK_DTD_DIR</tt>).</p></li></ul></div><p>In the directory <tt class="computeroutput">tools/build/new</tt> is a file
  120. named <tt class="filename">user-config.jam</tt>. Copy it to your home
  121. directory (or edit it in-place), and add a directive telling
  122. Boost.Build where to find the DocBook DTD and XSL stylesheets,
  123. replacing <tt class="computeroutput">DOCBOOK_XSL_DIR</tt> and
  124. <tt class="computeroutput">DOCBOOK_DTD_DIR</tt> with the paths of the DocBook XSL
  125. stylsheets and DTD, respectively:
  126. </p><pre class="programlisting"># BoostBook configuration
  127. using boostbook : DOCBOOK_XSL_DIR
  128. : DOCBOOK_DTD_DIR
  129. ;</pre><p>Future invocations of <b class="command">bjam</b> will use the
  130. specified local copies of the DTD and XSL stylesheets in lieu of
  131. downloading the same sources over the network.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="boostbook.fop"></a>Configuring Apache FOP for PostScript/PDF Output</h4></div></div><div></div></div><p>This section describes the steps required to configure
  132. <a href="http://xml.apache.org/fop/index.html" target="_top">Apache
  133. FOP</a> to generate PostScript and PDF output for BoostBook
  134. documents. To begin, you will need two pieces of software:
  135. </p><div class="itemizedlist"><ul type="disc"><li>A Java interpreter, available at <a href="http://java.sun.com" target="_top">http://java.sun.com</a>.</li><li>Apache FOP, available at <a href="http://xml.apache.org/fop/download.html" target="_top">http://xml.apache.org/fop/download.html</a>. Version 0.20.4 seems to be most stable.</li></ul></div><p>Once Java is installed (we'll call Java's directory
  136. <tt class="computeroutput">JAVA_HOME</tt>) and Apache FOP has been extracted into a
  137. directory (we'll call FOP's directory <tt class="computeroutput">FOP_DIR</tt>), we
  138. need to configure Boost.Build to use FOP. Edit your
  139. <tt class="filename">user-config.jam</tt> or
  140. <tt class="filename">site-config.jam</tt> and add the following,
  141. replacing <tt class="computeroutput">FOP_DIR</tt> with the directory where Apache
  142. FOP is installed, and replace <tt class="computeroutput">JAVA_HOME</tt> with the
  143. directory where Java is installed:
  144. </p><pre class="programlisting">using fop : FOP_DIR
  145. : JAVA_HOME
  146. ;</pre><p>
  147. In some cases, <tt class="computeroutput">JAVA_HOME</tt> is optional, but it often
  148. helps to specify it.</p><p>To test PDF generation, switch to the directory <tt class="filename">$BOOST_ROOT/doc</tt> and execute the
  149. command <b class="command">bjam --v2 pdf</b>. In the absence of any
  150. errors, Apache FOP will be executed to transform the XSL:FO
  151. output of DocBook into a PDF file.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="boostbook.doxygen"></a>Configuring Doxygen for Documentation Extraction</h4></div></div><div></div></div><p>This section details the steps necessary to use Doxygen to
  152. extract documentation and comments from source code to build a
  153. BoostBook document (and transform it into end-user
  154. documentation). You will need a somewhat recent version of <a href="http://www.doxygen.org" target="_top">Doxygen</a>; 1.2.18 or newer should suffice.</p><p>Boost.Build can be configured for Doxygen support by editing
  155. <tt class="filename">user-config.jam</tt> or
  156. <tt class="filename">site-config.jam</tt> to add:
  157. </p><pre class="programlisting">using doxygen : DOXYGEN ;</pre><p><tt class="filename">DOXYGEN</tt> should be replaced with the name of
  158. the <b class="command">doxygen</b> executable (with full path
  159. name). If the right <b class="command">doxygen</b> executable can be
  160. found via the path, this parameter can be omitted.</p><p>Generating of documentation from source files using
  161. Doxygen requires two steps. The first step involves identifying
  162. the source files so that Doxygen can process them. The second
  163. step is to specify that the output of this process, a file in
  164. the Doxygen XML format, is input for a BoostBook document. The
  165. following <tt class="filename">Jamfile.v2</tt> illustrates a simple
  166. case of generating reference documentation for the
  167. <a href="any.html" title="Boost.Any">Any</a> library: </p><pre class="programlisting">project boost/any/doc ;
  168. import boostbook : boostbook ;
  169. import doxygen : doxygen ;
  170. doxygen any.doxygen : ../../../boost/any.hpp ;
  171. boostbook any : any.doxygen ;</pre><p>In this example, we generate the Doxygen XML
  172. representation in the file <tt class="filename">any.doxygen</tt> from
  173. the source file <tt class="filename">../../../boost/any.hpp</tt> by
  174. invocing Doxygen. We then use <tt class="filename">any.doxygen</tt>
  175. as a source for the BoostBook target <tt class="computeroutput">any</tt>, which
  176. will generate documentation in any format the user requests. The
  177. actual sequence of events in this transformation is:</p><div class="orderedlist"><ol type="1"><li>Doxygen parses the header file <tt class="filename">../../../boost/any.hpp</tt> and outputs a single XML file <tt class="filename">any.doxygen</tt>.</li><li>The XSLT processor applies the stylesheet <tt class="filename">doxygen2boostbook.xsl</tt> to transform <tt class="filename">any.doxygen</tt> into the BoostBook file <tt class="filename">any.xml</tt>.</li><li>The XSLT processor applies the stylesheet <tt class="filename">docbook.xsl</tt> to transform <tt class="filename">any.xml</tt> into the DocBook XML document <tt class="filename">any.docbook</tt>.</li><li>Further transformations may generate HTML, FO, PDF, etc. from <tt class="filename">any.docbook</tt>.</li></ol></div></div></div><table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr><td align="left"><small>Last revised: , at GMT</small></td><td align="right"><small>Copyright © 2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="boostbook.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="boostbook.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="boostbook.documenting.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">The BoostBook Documentation Format </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Documenting libraries</td></tr></table></div></body></html>
粤ICP备19079148号