Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/tools/boostbook/doc/together.xml @ 30

Last change on this file since 30 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 3.5 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
4 
5   Distributed under the Boost Software License, Version 1.0.
6   (See accompanying file LICENSE_1_0.txt or copy at
7   http://www.boost.org/LICENSE_1_0.txt)
8  -->
9<!DOCTYPE chapter PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
10  "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
11<chapter xmlns:xi="http://www.w3.org/2001/XInclude" id="boostbook.together"
12         last-revision="$Date: 2006/11/03 19:39:44 $">
13  <title>Bringing Together a BoostBook Document</title>
14
15  <section id="boostbook.linking">
16    <title>Linking in BoostBook</title> 
17
18    <para>How one links to another element in BoostBook depends
19    greatly on the nature of the element linked and how the link
20    should appear. There are three general linking elements:
21    &lt;xref&gt;, &lt;link&gt;, and &lt;ulink&gt;. Additionally, there
22    are linking elements for referencing specific types of entities,
23    such as classes (&lt;classname&gt;), functions
24    (&lt;functionname&gt;), or libraries (&lt;libraryname&gt;).</para>
25
26    <para>The &lt;xref&gt; element references elements that have an
27    <code>id</code> attribute and a title. The actual link text is
28    composed from title and type of the element referenced. To link to
29    a particular ID, create an &lt;xref&gt; element with the
30    <code>linkend</code> attribute set to the ID of the intended
31    target. For instance, this section's ID is
32    <code>boostbook.linking</code>, so we create a reference it to
33    with <code>&lt;xref linkend="boostbook.linking"/&gt;</code>, which
34    will look like this in the text: <xref
35    linkend="boostbook.linking"/>.</para>
36
37    <para>The &lt;link&gt; element references an ID in the same way as
38    &lt;xref&gt;, except that &lt;link&gt; does not generate any text
39    for the link, so text must be supplied within the element. For
40    instance, we can again link to this chapter but this time specify
41    our own text with <code>&lt;link
42    linkend="boostbook.linking"&gt;like this&lt;/link&gt;</code>. This
43    markup will result in a link to this chapter that looks <link
44    linkend="boostbook.linking">like this</link>.</para>
45
46    <para>The &lt;ulink&gt; element references a URL that is outside
47    of the DocBook document. The <code>url</code> attribute contains
48    the URL to link to, and the element data provides the link
49    text.For instance, we can link to the the Boost web site with
50    <code>&lt;ulink
51    url="http://www.boost.org"&gt;Boost&lt;/ulink&gt;,</code> which
52    appears in the document like this: <ulink
53    url="http://www.boost.org">Boost</ulink>.</para>
54
55    <para>The &lt;classname&gt;, &lt;functionname&gt;,
56    &lt;methodname&gt;, and &lt;libraryname&gt; link to classes,
57    functions, methods, and libraries, respectively. The text of each
58    element gives both the name of the element to link to and the link
59    text. For instance, we can link to the Function library with
60    <code>&lt;libraryname&gt;Function&lt;/libraryname&gt;</code>,
61    which results in the following:
62    <libraryname>Function</libraryname>. In cases where the displayed
63    text is different from the actual name, the <code>alt</code>
64    attribute can be specified. For instance, the following XML
65    element references the <classname>boost::function</classname>
66    class template but displays the text <classname
67    alt="boost::function">function</classname>: <code>&lt;classname
68    alt="boost::function"&gt;function&lt;/classname&gt;</code>.</para>
69  </section>
70</chapter>
Note: See TracBrowser for help on using the repository browser.