Automatized preface pages labeling.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@7556 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
Manuel Canales Esparcia 2006-04-21 20:24:52 +00:00
parent 962a927c9e
commit dc931cb251
8 changed files with 47 additions and 9 deletions

View File

@ -5,7 +5,7 @@
%general-entities;
]>
<sect1 id="pre-audience" label="ii">
<sect1 id="pre-audience">
<?dbhtml filename="audience.html"?>
<title>Audience</title>

View File

@ -5,7 +5,7 @@
%general-entities;
]>
<sect1 id="pre-errata" label="vii">
<sect1 id="pre-errata">
<?dbhtml filename="errata.html"?>
<title>Errata</title>

View File

@ -5,7 +5,7 @@
%general-entities;
]>
<sect1 id="pre-foreword" label="i">
<sect1 id="pre-foreword">
<?dbhtml filename="foreword.html"?>
<title>Foreword</title>

View File

@ -5,7 +5,7 @@
%general-entities;
]>
<sect1 id="pre-hostreqs" label="iv">
<sect1 id="pre-hostreqs">
<?dbhtml filename="hostreqs.html"?>
<title>Host System Requirements</title>

View File

@ -5,7 +5,7 @@
%general-entities;
]>
<sect1 id="pre-organization" label="vi">
<sect1 id="pre-organization">
<?dbhtml filename="organization.html"?>
<title>Structure</title>

View File

@ -5,7 +5,7 @@
%general-entities;
]>
<sect1 id="pre-prerequisites" label="iii">
<sect1 id="pre-prerequisites">
<?dbhtml filename="prerequisites.html"?>
<title>Prerequisites</title>

View File

@ -5,7 +5,7 @@
%general-entities;
]>
<sect1 id="pre-typography" label="v">
<sect1 id="pre-typography">
<?dbhtml filename="typography.html"?>
<title>Typography</title>

View File

@ -48,12 +48,50 @@
<xsl:call-template name="process.chunk.footnotes"/>
</div>
</xsl:template>
<!-- Sections numbering -->
<xsl:param name="section.autolabel" select="1"/>
<xsl:param name="section.label.includes.component.label" select="1"/>
<!-- Skip numeraration for sections with empty title -->
<!-- Use lowercase roman numbers for sect1 in preface -->
<xsl:template match="sect1" mode="label.markup">
<!-- if the parent is a component, maybe label that too -->
<xsl:variable name="parent.is.component">
<xsl:call-template name="is.component">
<xsl:with-param name="node" select=".."/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="component.label">
<xsl:if test="$section.label.includes.component.label != 0
and $parent.is.component != 0">
<xsl:variable name="parent.label">
<xsl:apply-templates select=".." mode="label.markup"/>
</xsl:variable>
<xsl:if test="$parent.label != ''">
<xsl:apply-templates select=".." mode="label.markup"/>
<xsl:apply-templates select=".." mode="intralabel.punctuation"/>
</xsl:if>
</xsl:if>
</xsl:variable>
<xsl:choose>
<xsl:when test="@label">
<xsl:value-of select="@label"/>
</xsl:when>
<xsl:when test="$section.autolabel != 0">
<xsl:copy-of select="$component.label"/>
<xsl:choose>
<xsl:when test="ancestor::preface">
<xsl:number format="i" count="sect1"/>
</xsl:when>
<xsl:otherwise>
<xsl:number format="1" count="sect1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:template>
<!-- Skip numeration for sect2 with empty title -->
<xsl:template match="sect2|sect3|sect4|sect5" mode="label.markup">
<xsl:if test="string-length(title) > 0">
<!-- label the parent -->