summaryrefslogtreecommitdiff
path: root/doc/xslt/C/gnome-doc-xslt.xml
blob: a53528412cdc70c117ae8c77b1f3b679fdb990f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
<?xml version="1.0" encoding="UTF-8"?><!-- -*- indent-tabs-mode: nil -*- -->
<?db.chunk.max_depth 2?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<article id="index" lang="en">
  <articleinfo>
    <title>GNOME Documentation XSLT Manual</title>
    
    <abstract role="description">
      <para>The GNOME Documentation XSLT stylesheets were created to provide fast DocBook to HTML
      conversion for real-time document viewing in GNOME's help browser, <application>Yelp.</application></para>
    </abstract>

    <copyright>
      <year>2004</year>

      <holder>Shaun McCance</holder>
    </copyright>

    <publisher>
      <publishername>GNOME Documentation Project</publishername>
    </publisher>

    <include href="legal.xml" xmlns="http://www.w3.org/2001/XInclude" />

    <authorgroup>
      <author role="maintainer">
        <firstname>Shaun</firstname>

        <surname>McCance</surname>

        <affiliation>
          <orgname>GNOME Documentation Project</orgname>
        </affiliation>

        <email>shaunm@gnome.org</email>
      </author>

      <author>
        <firstname>Brent</firstname>

        <surname>Smith</surname>

        <affiliation>
          <orgname>GNOME Documentation Project</orgname>
        </affiliation>

        <email>gnome@nextreality.net</email>
      </author>
    </authorgroup>

    <revhistory>
      <revision>
        <revnumber>0.1</revnumber>

        <date>2004-03-31</date>
      </revision>

      <revision>
        <revnumber>0.2</revnumber>

        <date>2006-02-11</date>
      </revision>
    </revhistory>
  </articleinfo>

  <section id="intro">
    <title>Introduction</title>

    <para>The GNOME XSLT Stylesheets are used to generate HTML from DocBook
    files.</para>

    <para>Some of the goals of these stylesheets are:<itemizedlist>
        <listitem>
          <para>To provide real-time translation of DocBook into HTML. The
          GNOME Help Browser, <application>Yelp</application>, uses these
          stylesheets to format help documents.</para>
        </listitem>

        <listitem>
          <para>To provide a customized look and feel for GNOME's
          documentation.</para>
        </listitem>

        <listitem>
          <para>To provide translation support for GNOME documentation.</para>
        </listitem>
      </itemizedlist></para>
  </section>

  <section id="using">
    <title>Using the Stylesheets</title>

    <para>To use the stylesheets you should be familiar with the
    <application>xsltproc</application> application. The first argument is the
    location of the <filename>db2html.xsl</filename> stylesheet. The second
    argument is the top-level docbook file for which to generate the
    HTML.</para>

    <example id="example-db2html">
      <title>Generating HTML from a DocBook file</title>

      <para><screen><prompt>$</prompt> xsltproc /usr/share/xml/gnome/xslt/docbook/html/db2html.xsl &lt;docbook file&gt;</screen></para>
    </example>

    <para>For more information on <application>xsltproc</application> and the
    <application>libxslt</application> libraries, see <ulink
    url="http://www.xmlsoft.org/">http://xmlsoft.org/</ulink>.</para>

    <note>
      <title>XInclude Processing</title>

      <para>If you make use of <ulink
      url="http://www.w3.org/TR/xinclude/">XInclude</ulink> to include other
      files in your document, then you must use the 
      <parameter>--xinclude</parameter> parameter to generate the complete
      DocBook file before processing it with the
      <filename>db2html.xsl</filename> stylesheet(s).</para>
    </note>
  </section>

  <section id="parameters">
    <title>Specifying Parameters</title>

    <para>There are a number of parameters available in the stylesheets which
    you can set to customize the generated html. An exhaustive list is
    available in the following sections, but we will go over a few of the more
    commonly used ones in this section.</para>

    <para>To specify a parameter to the stylesheets, use the
    <parameter>--stringparam</parameter> option of the
    <application>xsltproc</application> application.</para>

    <variablelist>
      <varlistentry>
        <term>db.chunk.chunk_top</term>

        <listitem>
          <para>Set this parameter to <literal>1</literal> if you want the
          stylesheets to chunk<footnote>
              <para>Chunking refers to creating a separate output file for an
              element. For example, if there are three
              <literal>&lt;sect1&gt;</literal> elements within a document,
              (with no subsections) then there will be three files generated
              for each element. Incidentally, the name of the files will be
              the same as the element's <literal>id</literal>
              attribute.</para>
            </footnote> the top level element
          (<literal>&lt;article&gt;</literal> or
          <literal>&lt;book&gt;</literal>) into a file called
          <filename>index.xhtml</filename>.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>db.chunk.max_depth</term>

        <listitem>
          <para>Specifies the maximum depth of chunked elements specified in
          <parameter>db.chunk.chunks</parameter> parameter.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>db.chunk.extension</term>

        <listitem>
          <para>Set this parameter to <literal>the extension</literal> you
          would like for the chunked output files.</para>
        </listitem>
      </varlistentry>
    </variablelist>

    <example id="example-parameters">
      <title>Example of specifying stylesheet parameters</title>

      <para><screen><prompt>$</prompt> xsltproc \
   --stringparam db.chunk.chunk_top 1        \
   --stringparam db.chunk.max_depth 1        \
   --stringparam db.chunk.extension '.html'  \
   /usr/share/xml/gnome/xslt/docbook/html/db2html.xsl \
   &lt;path to docbook file&gt;</screen><xref
      linkend="example-parameters" /> will chunk the top level element, chunk
      to a maximum depth of 1 and chunk the title page.</para>
    </example>
  </section>

  <section id="limitations">
    <title>Limitations</title>

    <para>Currently, the stylesheets require that there be an
    <literal>id</literal> attribute on each chunked element.</para>
  </section>

  <include href="translating.xml" xmlns="http://www.w3.org/2001/XInclude"/>

  <section id="reference">
    <title>Stylesheet Reference</title>

    <!--BEGIN-->
    <include href="db-chunk.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db-common.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db-label.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db-title.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db-xref.xml" xmlns="http://www.w3.org/2001/XInclude"/>

    <include href="db2html.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2xhtml.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2html-autotoc.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2html-bibliography.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2html-block.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2html-callout.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2html-classsynopsis.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2html-cmdsynopsis.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2html-css.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2html-division.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2html-ebnf.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2html-footnote.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2html-funcsynopsis.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2html-index.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2html-info.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2html-inline.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2html-l10n.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2html-list.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2html-media.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2html-qanda.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2html-refentry.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2html-table.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2html-title.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="db2html-xref.xml" xmlns="http://www.w3.org/2001/XInclude"/>

    <include href="db2omf.xml" xmlns="http://www.w3.org/2001/XInclude"/>

    <include href="theme.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="utils.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="gettext.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <include href="l10n-numbers.xml" xmlns="http://www.w3.org/2001/XInclude"/>
    <!--END-->
  </section>

</article>