summaryrefslogtreecommitdiff
path: root/asciidoc-docbook-xsl.html
blob: 6b8cb53e9012ef343467df1ee27f66fd26465491 (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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 10.0.0a2" />
<title>AsciiDoc DocBook XSL Stylesheets Notes</title>
<link rel="stylesheet" href="./asciidoc.css" type="text/css" />
<link rel="stylesheet" href="./layout2.css" type="text/css" />
<script type="text/javascript" src="./asciidoc.js"></script>
<script type="text/javascript">
/*<![CDATA[*/
asciidoc.install();
/*]]>*/
</script>
</head>
<body style="max-width:70em">
<div id="layout-menu-box">
<div id="layout-menu">
  <div>&#187;<a href="index.html">Home</a></div>
  <div>&#187;<a href="userguide.html">User&nbsp;Guide</a></div>
  <div>&#187;<a href="INSTALL.html">Installation</a></div>
  <div>&#187;<a href="faq.html">FAQ</a></div>
  <div>&#187;<a href="manpage.html">asciidoc(1)</a></div>
  <div>&#187;<a href="a2x.1.html">a2x(1)</a></div>
  <div>&#187;<a href="asciidocapi.html">API</a></div>
  <div>&#187;<a href="plugins.html">Plugins</a></div>
  <div>&#187;<a href="http://powerman.name/doc/asciidoc">Cheatsheet</a></div>
  <div>&#187;<a href="testasciidoc.html">Tests</a></div>
  <div>&#187;<a href="CHANGELOG.html">ChangeLog</a></div>
  <div>&#187;<a href="support.html">Support</a></div>
  <div id="page-source">&#187;<a href="asciidoc-docbook-xsl.txt">Page&nbsp;Source</a></div>
</div>
</div>
<div id="layout-content-box">
<div id="layout-banner">
  <div id="layout-title">AsciiDoc</div>
  <div id="layout-description">Text based document generation</div>
</div>
<div id="layout-content">
<div id="header">
<h1>AsciiDoc DocBook XSL Stylesheets Notes</h1>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph"><p>Output file customisation is achieved by tweaking the DocBook XSL
stylesheets.  I&#8217;ve tried to keep customization to a minimum and
confine it to the separate XSL driver files in the distribution
<code>./docbook-xsl/</code> directory (see the User Guide for details).</p></div>
<div class="paragraph"><p>To polish some rough edges I&#8217;ve written some patches for the DocBook
XSL stylesheets&#8201;&#8212;&#8201;you don&#8217;t need them but they&#8217;re documented below
and included in the distribution <code>./docbook-xsl/</code> directory.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_manually_upgrading_debian_to_the_latest_docbook_xsl_stylesheets">Manually upgrading Debian to the latest DocBook XSL stylesheets</h2>
<div class="sectionbody">
<div class="paragraph"><p>The DocBook XSL Stylesheets distribution is just a directory full of
text files and you can switch between releases by changing the
directory name in the system XML catalog.</p></div>
<div class="paragraph"><p>To upgrade to the latest docbook-xsl stylesheets without having to
wait for the Debian <code>docbook-xsl</code> package:</p></div>
<div class="ulist"><ul>
<li>
<p>
Download the latest docbook-xsl tarball from
  <a href="https://github.com/docbook/xslt10-stylesheets">https://github.com/docbook/xslt10-stylesheets</a>. Bleeding edge snapshots
  can be found at <a href="https://github.com/docbook/xslt10-stylesheets/releases">https://github.com/docbook/xslt10-stylesheets/releases</a>.
</p>
</li>
<li>
<p>
Unzip the tarball to <code>/usr/share/xml/docbook/stylesheet/</code>:
</p>
<div class="literalblock">
<div class="content">
<pre><code>$ cd /usr/share/xml/docbook/stylesheet
$ sudo tar -xzf /tmp/docbook-xsl-1.72.0.tar.gz</code></pre>
</div></div>
</li>
<li>
<p>
Edit <code>/etc/xml/docbook-xsl.xml</code> catalog and replace occurrences of
  the current stylesheets directory with the new one (in our example
  it would be <code>/usr/share/xml/docbook/stylesheet/docbook-xsl-1.72.0</code>.
</p>
<div class="literalblock">
<div class="content">
<pre><code>$ cd /etc/xml/
$ sudo cp -p docbook-xsl.xml docbook-xsl.xml.ORIG
$ sudo vi docbook-xsl.xml</code></pre>
</div></div>
</li>
</ul></div>
</div>
</div>
<div class="sect1">
<h2 id="_customizing_generated_text">Customizing Generated Text</h2>
<div class="sectionbody">
<div class="paragraph"><p>An example
<a href="http://www.sagehill.net/docbookxsl/CustomGentext.html#CustomGenText">DocBook
XSL Stylesheets customization file</a> for formatting chapter titles
without chapter numbering.</p></div>
<div class="listingblock">
<div class="title">custom-chapter.xml</div>
<div class="content">
<pre><code>&lt;!-- Customize chapter title --&gt;
&lt;l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"&gt;
  &lt;l:l10n language="en"&gt;
    &lt;l:context name="title"&gt;
      &lt;l:template name="chapter" text="%t"/&gt;
    &lt;/l:context&gt;
  &lt;/l:l10n&gt;
&lt;/l:i18n&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Executed with this <em>xsltproc</em> parameter:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>--param local.l10n.xml document\(\'custom-chapter.xml\'\)</code></pre>
</div></div>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<img src="./images/icons/note.png" alt="Note" />
</td>
<td class="content">This example is hypothetical&#8201;&#8212;&#8201;use the <em>xsltproc</em>
<code>--stringparam chapter.autolabel 0</code> option to do the same job.</td>
</tr></table>
</div>
</div>
</div>
</div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Version 9.1.0<br />
Last updated 2021-03-31 01:13:47 UTC<br />
AsciiDoc is a trademark of the Eclipse Foundation, Inc.
</div>
<div id="footer-badges">
<a href="https://validator.w3.org/check?uri=referer">
  <img style="border:0;width:88px;height:31px"
    src="https://www.w3.org/Icons/valid-xhtml11-blue"
    alt="Valid XHTML 1.1" height="31" width="88" />
</a>
<a href="https://jigsaw.w3.org/css-validator/">
  <img style="border:0;width:88px;height:31px"
    src="https://jigsaw.w3.org/css-validator/images/vcss-blue"
    alt="Valid CSS!" />
</a>
</div>
</div>
</div>
</div>
</body>
</html>