Author: manuel
Date: 2007-03-31 11:54:58 -0600 (Sat, 31 Mar 2007)
New Revision: 7995
Modified:
branches/new-xsl/xhtml/lfs-titles.xsl
branches/new-xsl/xhtml/lfs-xref.xsl
Log:
Revised xhtml/lfs-titles.xsl
Modified: branches/new-xsl/xhtml/lfs-titles.xsl
===================================================================
--- branches/new-xsl/xhtml/lfs-titles.xsl 2007-03-31 16:38:33 UTC (rev
7994)
+++ branches/new-xsl/xhtml/lfs-titles.xsl 2007-03-31 17:54:58 UTC (rev
7995)
@@ -4,17 +4,26 @@
xmlns="http://www.w3.org/1999/xhtml"
version="1.0">
- <xsl:template name="part.titlepage">
+ <!-- REVISED -->
+
+ <!-- This stylesheet controls the h* xhtml tags used for several titles -->
+
+ <!-- preface.titlepage:
+ Uses h1 and removed a lot of unneeded code.
+ No label in preface. -->
+ <!-- The original template is in
{docbook-xsl}/xhtml/titlepage.templates.xsl -->
+ <xsl:template name="preface.titlepage">
<div class="titlepage">
<h1 class="{name(.)}">
- <xsl:apply-templates select="." mode="label.markup"/>
- <xsl:text>. </xsl:text>
<xsl:value-of select="title"/>
</h1>
</div>
</xsl:template>
- <xsl:template name="chapter.titlepage">
+ <!-- part.titlepage:
+ Uses h1 and removed a lot of unneeded code. -->
+ <!-- The original template is in
{docbook-xsl}/xhtml/titlepage.templates.xsl -->
+ <xsl:template name="part.titlepage">
<div class="titlepage">
<h1 class="{name(.)}">
<xsl:apply-templates select="." mode="label.markup"/>
@@ -24,15 +33,23 @@
</div>
</xsl:template>
- <xsl:template name="preface.titlepage">
+ <!-- appendix.titlepage:
+ Uses h1 and removed a lot of unneeded code. -->
+ <!-- The original template is in
{docbook-xsl}/xhtml/titlepage.templates.xsl -->
+ <xsl:template name="appendix.titlepage">
<div class="titlepage">
<h1 class="{name(.)}">
+ <xsl:apply-templates select="." mode="label.markup"/>
+ <xsl:text>. </xsl:text>
<xsl:value-of select="title"/>
</h1>
</div>
</xsl:template>
- <xsl:template name="appendix.titlepage">
+ <!-- chapter.titlepage:
+ Uses h1 and removed a lot of unneeded code. -->
+ <!-- The original template is in
{docbook-xsl}/xhtml/titlepage.templates.xsl -->
+ <xsl:template name="chapter.titlepage">
<div class="titlepage">
<h1 class="{name(.)}">
<xsl:apply-templates select="." mode="label.markup"/>
@@ -42,9 +59,13 @@
</div>
</xsl:template>
+ <!-- sect1.titlepage:
+ Uses h1 except for the first section, and removed a lot of unneeded
code. -->
+ <!-- The original template is in
{docbook-xsl}/xhtml/titlepage.templates.xsl -->
<xsl:template name="sect1.titlepage">
<xsl:choose>
- <!-- I should find a better test -->
+ <!-- I should find a better test, but if chapter TOC is readded
+ h1 will be used always, thus no need to worry for now. -->
<xsl:when test="position() = 4">
<div class="titlepage">
<xsl:if test="@id">
@@ -69,6 +90,11 @@
</xsl:choose>
</xsl:template>
+ <!-- sect2.titlepage:
+ Uses h2 and removed a lot of unneeded code.
+ Skip empty titles.
+ No label in preface. -->
+ <!-- The original template is in
{docbook-xsl}/xhtml/titlepage.templates.xsl -->
<xsl:template name="sect2.titlepage">
<xsl:choose>
<xsl:when test="string-length(title) = 0"/>
@@ -89,29 +115,26 @@
</xsl:choose>
</xsl:template>
- <xsl:template name="dedication.titlepage">
- <div class="titlepage">
- <h2 class="{name(.)}">
- <xsl:value-of select="title"/>
- </h2>
- </div>
+ <!-- bridgehead:
+ When use always renderas attributes and want the output h* level
+ matching the defined sect* level. -->
+ <!-- The original template is in {docbook-xsl}/xhtml/sections.xsl -->
+ <xsl:template match="bridgehead">
+ <xsl:variable name="hlevel">
+ <xsl:choose>
+ <xsl:when test="@renderas = 'sect1'">1</xsl:when>
+ <xsl:when test="@renderas = 'sect2'">2</xsl:when>
+ <xsl:when test="@renderas = 'sect3'">3</xsl:when>
+ <xsl:when test="@renderas = 'sect4'">4</xsl:when>
+ <xsl:when test="@renderas = 'sect5'">5</xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:element name="h{$hlevel}" namespace="http://www.w3.org/1999/xhtml">
+ <xsl:call-template name="anchor">
+ <xsl:with-param name="conditional" select="0"/>
+ </xsl:call-template>
+ <xsl:apply-templates/>
+ </xsl:element>
</xsl:template>
- <!-- Added the role param for proper punctuation in xref calls. -->
- <xsl:template match="*" mode="insert.title.markup">
- <xsl:param name="purpose"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="title"/>
- <xsl:param name="role"/>
- <xsl:choose>
- <xsl:when test="$purpose = 'xref' and titleabbrev">
- <xsl:apply-templates select="." mode="titleabbrev.markup"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="$title"/>
- <xsl:value-of select="$role"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
</xsl:stylesheet>
Modified: branches/new-xsl/xhtml/lfs-xref.xsl
===================================================================
--- branches/new-xsl/xhtml/lfs-xref.xsl 2007-03-31 16:38:33 UTC (rev 7994)
+++ branches/new-xsl/xhtml/lfs-xref.xsl 2007-03-31 17:54:58 UTC (rev 7995)
@@ -289,4 +289,22 @@
</xsl:choose>
</xsl:template>
+ <!-- insert.title.markup:
+ Added the role param for proper punctuation in xref calls. -->
+ <xsl:template match="*" mode="insert.title.markup">
+ <xsl:param name="purpose"/>
+ <xsl:param name="xrefstyle"/>
+ <xsl:param name="title"/>
+ <xsl:param name="role"/>
+ <xsl:choose>
+ <xsl:when test="$purpose = 'xref' and titleabbrev">
+ <xsl:apply-templates select="." mode="titleabbrev.markup"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="$title"/>
+ <xsl:value-of select="$role"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
</xsl:stylesheet>
--
http://linuxfromscratch.org/mailman/listinfo/lfs-book
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page