...one of the most highly
regarded and expertly designed C++ library projects in the
world. — Herb Sutter and Andrei
How one links to another element in BoostBook depends greatly on the nature of the element linked and how the link should appear. There are three general linking elements: <xref>, <link>, and <ulink>. Additionally, there are linking elements for referencing specific types of entities, such as classes (<classname>), functions (<functionname>), or libraries (<libraryname>).
The <xref> element references elements that have an
id attribute and a title. The actual link text is
composed from title and type of the element referenced. To link to
a particular ID, create an <xref> element with the
linkend attribute set to the ID of the intended
target. For instance, this section's ID is
boostbook.linking, so we create a reference it to
<xref linkend="boostbook.linking"/>, which
will look like this in the text: the section called “Linking in BoostBook”.
The <link> element references an ID in the same way as
<xref>, except that <link> does not generate any text
for the link, so text must be supplied within the element. For
instance, we can again link to this chapter but this time specify
our own text with
linkend="boostbook.linking">like this</link>. This
markup will result in a link to this chapter that looks like this.
The <ulink> element references a URL that is outside
of the DocBook document. The
url attribute contains
the URL to link to, and the element data provides the link
text.For instance, we can link to the the Boost web site with
appears in the document like this: Boost.
In BoostBook, <ulink> supports a custom url schema for
linking to files within the boost distribution. This is formed by
url attribute to
followed by the file's path. For example, we can link to the
flyweight library with
which will appear like this: Boost.Flyweight.
This schema is only supported for BoostBook <ulink> elements.
It isn't available for any other elements or in Docbook.
The <classname>, <functionname>,
<methodname>, and <libraryname> link to classes,
functions, methods, and libraries, respectively. The text of each
element gives both the name of the element to link to and the link
text. For instance, we can link to the Function library with
which results in the following:
Function. In cases where the displayed
text is different from the actual name, the
attribute can be specified. For instance, the following XML
element references the
class template but displays the text