| [29] | 1 | <html> | 
|---|
 | 2 | <head> | 
|---|
 | 3 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | 
|---|
 | 4 | <title>Bringing Together a BoostBook Document</title> | 
|---|
 | 5 | <link rel="stylesheet" href="../boostbook.css" type="text/css"> | 
|---|
 | 6 | <meta name="generator" content="DocBook XSL Stylesheets V1.68.1"> | 
|---|
 | 7 | <link rel="start" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> | 
|---|
 | 8 | <link rel="up" href="../boostbook.html" title="Chapter 22. The BoostBook Documentation Format"> | 
|---|
 | 9 | <link rel="prev" href="documenting.html" title="Documenting libraries"> | 
|---|
 | 10 | <link rel="next" href="../reference.html" title="Reference"> | 
|---|
 | 11 | </head> | 
|---|
 | 12 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> | 
|---|
 | 13 | <table cellpadding="2" width="100%"> | 
|---|
 | 14 | <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td> | 
|---|
 | 15 | <td align="center"><a href="../../../index.htm">Home</a></td> | 
|---|
 | 16 | <td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td> | 
|---|
 | 17 | <td align="center"><a href="../../../people/people.htm">People</a></td> | 
|---|
 | 18 | <td align="center"><a href="../../../more/faq.htm">FAQ</a></td> | 
|---|
 | 19 | <td align="center"><a href="../../../more/index.htm">More</a></td> | 
|---|
 | 20 | </table> | 
|---|
 | 21 | <hr> | 
|---|
 | 22 | <div class="spirit-nav"> | 
|---|
 | 23 | <a accesskey="p" href="documenting.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../boostbook.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../reference.html"><img src="../images/next.png" alt="Next"></a> | 
|---|
 | 24 | </div> | 
|---|
 | 25 | <div class="section" lang="en"> | 
|---|
 | 26 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | 
|---|
 | 27 | <a name="boostbook.together"></a>Bringing Together a BoostBook Document</h2></div></div></div> | 
|---|
 | 28 | <div class="toc"><dl><dt><span class="section"><a href="together.html#boostbook.linking">Linking in BoostBook</a></span></dt></dl></div> | 
|---|
 | 29 | <div class="section" lang="en"> | 
|---|
 | 30 | <div class="titlepage"><div><div><h3 class="title"> | 
|---|
 | 31 | <a name="boostbook.linking"></a>Linking in BoostBook</h3></div></div></div> | 
|---|
 | 32 | <p>How one links to another element in BoostBook depends | 
|---|
 | 33 |     greatly on the nature of the element linked and how the link | 
|---|
 | 34 |     should appear. There are three general linking elements: | 
|---|
 | 35 |     <xref>, <link>, and <ulink>. Additionally, there | 
|---|
 | 36 |     are linking elements for referencing specific types of entities, | 
|---|
 | 37 |     such as classes (<classname>), functions | 
|---|
 | 38 |     (<functionname>), or libraries (<libraryname>).</p> | 
|---|
 | 39 | <p>The <xref> element references elements that have an | 
|---|
 | 40 |     <code class="computeroutput">id</code> attribute and a title. The actual link text is | 
|---|
 | 41 |     composed from title and type of the element referenced. To link to | 
|---|
 | 42 |     a particular ID, create an <xref> element with the | 
|---|
 | 43 |     <code class="computeroutput">linkend</code> attribute set to the ID of the intended | 
|---|
 | 44 |     target. For instance, this section's ID is | 
|---|
 | 45 |     <code class="computeroutput">boostbook.linking</code>, so we create a reference it to | 
|---|
 | 46 |     with <code class="computeroutput"><xref linkend="boostbook.linking"/></code>, which | 
|---|
 | 47 |     will look like this in the text: <a href="together.html#boostbook.linking" title="Linking in BoostBook">the section called “Linking in BoostBook”</a>.</p> | 
|---|
 | 48 | <p>The <link> element references an ID in the same way as | 
|---|
 | 49 |     <xref>, except that <link> does not generate any text | 
|---|
 | 50 |     for the link, so text must be supplied within the element. For | 
|---|
 | 51 |     instance, we can again link to this chapter but this time specify | 
|---|
 | 52 |     our own text with <code class="computeroutput"><link | 
|---|
 | 53 |     linkend="boostbook.linking">like this</link></code>. This | 
|---|
 | 54 |     markup will result in a link to this chapter that looks <a href="together.html#boostbook.linking" title="Linking in BoostBook">like this</a>.</p> | 
|---|
 | 55 | <p>The <ulink> element references a URL that is outside | 
|---|
 | 56 |     of the DocBook document. The <code class="computeroutput">url</code> attribute contains | 
|---|
 | 57 |     the URL to link to, and the element data provides the link | 
|---|
 | 58 |     text.For instance, we can link to the the Boost web site with | 
|---|
 | 59 |     <code class="computeroutput"><ulink | 
|---|
 | 60 |     url="http://www.boost.org">Boost</ulink>,</code> which | 
|---|
 | 61 |     appears in the document like this: <a href="http://www.boost.org" target="_top">Boost</a>.</p> | 
|---|
 | 62 | <p>The <classname>, <functionname>, | 
|---|
 | 63 |     <methodname>, and <libraryname> link to classes, | 
|---|
 | 64 |     functions, methods, and libraries, respectively. The text of each | 
|---|
 | 65 |     element gives both the name of the element to link to and the link | 
|---|
 | 66 |     text. For instance, we can link to the Function library with | 
|---|
 | 67 |     <code class="computeroutput"><libraryname>Function</libraryname></code>, | 
|---|
 | 68 |     which results in the following: | 
|---|
 | 69 |     <a href="../function.html" title="Chapter 6. Boost.Function">Function</a>. In cases where the displayed | 
|---|
 | 70 |     text is different from the actual name, the <code class="computeroutput">alt</code> | 
|---|
 | 71 |     attribute can be specified. For instance, the following XML | 
|---|
 | 72 |     element references the <code class="computeroutput"><a href="../boost/function.html" title="Class template function">boost::function</a></code> | 
|---|
 | 73 |     class template but displays the text <code class="computeroutput"><a href="../boost/function.html" title="Class template function">function</a></code>: <code class="computeroutput"><classname | 
|---|
 | 74 |     alt="boost::function">function</classname></code>.</p> | 
|---|
 | 75 | </div> | 
|---|
 | 76 | </div> | 
|---|
 | 77 | <table width="100%"><tr> | 
|---|
 | 78 | <td align="left"></td> | 
|---|
 | 79 | <td align="right"><small>Copyright © 2003-2005 Douglas Gregor</small></td> | 
|---|
 | 80 | </tr></table> | 
|---|
 | 81 | <hr> | 
|---|
 | 82 | <div class="spirit-nav"> | 
|---|
 | 83 | <a accesskey="p" href="documenting.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../boostbook.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../reference.html"><img src="../images/next.png" alt="Next"></a> | 
|---|
 | 84 | </div> | 
|---|
 | 85 | </body> | 
|---|
 | 86 | </html> | 
|---|