1 | AsciiDoc DocBook XSL Stylesheets Notes |
---|
2 | ====================================== |
---|
3 | |
---|
4 | Output file customisation is achieved by tweaking the DocBook XSL |
---|
5 | stylesheets. I've tried to keep customization to a minimum and |
---|
6 | confine it to the separate XSL driver files in the distribution |
---|
7 | `./docbook-xsl/` directory (see the User Guide for details). |
---|
8 | |
---|
9 | To polish some rough edges I've written some patches for the DocBook |
---|
10 | XSL stylesheets -- you don't need them but they're documented below |
---|
11 | and included in the distribution `./docbook-xsl/` directory. |
---|
12 | |
---|
13 | |
---|
14 | Manually upgrading Debian to the latest DocBook XSL stylesheets |
---|
15 | --------------------------------------------------------------- |
---|
16 | The DocBook XSL Stylesheets distribution is just a directory full of |
---|
17 | text files and you can switch between releases by changing the |
---|
18 | directory name in the system XML catalog. |
---|
19 | |
---|
20 | To upgrade to the latest docbook-xsl stylesheets without having to |
---|
21 | wait for the Debian `docbook-xsl` package: |
---|
22 | |
---|
23 | - Download the latest docbook-xsl tarball from |
---|
24 | http://sourceforge.net/projects/docbook/. Bleeding edge snapshots |
---|
25 | can be found at http://docbook.sourceforge.net/snapshots/ |
---|
26 | |
---|
27 | - Unzip the tarball to `/usr/share/xml/docbook/stylesheet/`: |
---|
28 | |
---|
29 | $ cd /usr/share/xml/docbook/stylesheet |
---|
30 | $ sudo tar -xzf /tmp/docbook-xsl-1.72.0.tar.gz |
---|
31 | |
---|
32 | - Edit `/etc/xml/docbook-xsl.xml` catalog and replace occurences of |
---|
33 | the current stylesheets directory with the new one (in our example |
---|
34 | it would be `/usr/share/xml/docbook/stylesheet/docbook-xsl-1.72.0`. |
---|
35 | |
---|
36 | $ cd /etc/xml/ |
---|
37 | $ sudo cp -p docbook-xsl.xml docbook-xsl.xml.ORIG |
---|
38 | $ sudo vi docbook-xsl.xml |
---|
39 | |
---|
40 | |
---|
41 | Customizing Generated Text |
---|
42 | -------------------------- |
---|
43 | An example |
---|
44 | http://www.sagehill.net/docbookxsl/CustomGentext.html#CustomGenText[DocBook |
---|
45 | XSL Stylesheets customization file] for formatting chapter titles |
---|
46 | without chapter numbering. |
---|
47 | |
---|
48 | .custom-chapter.xml |
---|
49 | --------------------------------------------------------------------- |
---|
50 | <!-- Customize chapter title --> |
---|
51 | <l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"> |
---|
52 | <l:l10n language="en"> |
---|
53 | <l:context name="title"> |
---|
54 | <l:template name="chapter" text="%t"/> |
---|
55 | </l:context> |
---|
56 | </l:l10n> |
---|
57 | </l:i18n> |
---|
58 | --------------------------------------------------------------------- |
---|
59 | |
---|
60 | Executed with this 'xsltproc' parameter: |
---|
61 | |
---|
62 | --param local.l10n.xml document\(\'custom-chapter.xml\'\) |
---|
63 | |
---|
64 | NOTE: This example is hypothetical -- use the 'xsltproc' |
---|
65 | `--stringparam chapter.autolabel 0` option to do the same job. |
---|