diff options
author | Stuart Rackham <srackham@methods.co.nz> | 2009-06-14 13:14:26 +1200 |
---|---|---|
committer | Stuart Rackham <srackham@methods.co.nz> | 2009-06-14 13:14:26 +1200 |
commit | 01c226ecb4ae416a8ca42b2a61712e6fad867500 (patch) | |
tree | 7293c621d33238108138b4a241e1d053afa2f689 | |
parent | 09405c18822fb3bf543edb71fe65e752bbf31a68 (diff) | |
download | asciidoc-py3-01c226ecb4ae416a8ca42b2a61712e6fad867500.tar.gz |
Added conditional article and book section numbering when using XSL Stylesheets.
Numbers inserted if 'numbered' attribute is defined (same as html4 and xhtml11 behavior).
-rw-r--r-- | doc/asciidoc.txt | 6 | ||||
-rw-r--r-- | docbook-xsl/common.xsl | 7 | ||||
-rw-r--r-- | docbook.conf | 1 |
3 files changed, 10 insertions, 4 deletions
diff --git a/doc/asciidoc.txt b/doc/asciidoc.txt index b90d40b..b638aec 100644 --- a/doc/asciidoc.txt +++ b/doc/asciidoc.txt @@ -5258,11 +5258,11 @@ A short summary of changes in this document revision. Must be defined prior to the first document section. The document also needs to be dated to output this attribute. -|numbered |html4, xhtml11 | +|numbered |html4, xhtml11, docbook (XSL Stylesheets) | Adds section numbers to section titles. -|toc |xhtml11, docbook (XSL/FO) | -Adds a table of contents to the start of an article document. +|toc |xhtml11, docbook (XSL Stylesheets) | +Adds a table of contents to the start of an article or book document. NOTE: The `toc` attribute must be specified using the `--attribute` command-line option. If you define the `toc` attribute in a custom diff --git a/docbook-xsl/common.xsl b/docbook-xsl/common.xsl index 55ba86d..9b14d78 100644 --- a/docbook-xsl/common.xsl +++ b/docbook-xsl/common.xsl @@ -9,7 +9,12 @@ <xsl:param name="htmlhelp.chm" select="'htmlhelp.chm'"/>
<xsl:param name="htmlhelp.hhc.section.depth" select="5"/>
-<xsl:param name="section.autolabel" select="1"/>
+<xsl:param name="section.autolabel">
+ <xsl:choose>
+ <xsl:when test="/article/articleinfo/processing-instruction('asciidoc-numbered') or /book/articleinfo/processing-instruction('asciidoc-numbered')">1</xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+</xsl:param>
<xsl:param name="suppress.navigation" select="0"/>
<xsl:param name="navig.graphics.extension" select="'.png'"/>
diff --git a/docbook.conf b/docbook.conf index 5e35bbe..c677bae 100644 --- a/docbook.conf +++ b/docbook.conf @@ -495,6 +495,7 @@ template::[header-declarations] <articleinfo>
template::[docinfo]
{toc#}<?asciidoc-toc?>
+{numbered#}<?asciidoc-numbered?>
</articleinfo>
[footer]
|