diff options
author | Manuel Canales Esparcia <manuel@linuxfromscratch.org> | 2004-05-20 21:48:55 +0000 |
---|---|---|
committer | Manuel Canales Esparcia <manuel@linuxfromscratch.org> | 2004-05-20 21:48:55 +0000 |
commit | a34ad80e86383ab1483b677acf54abeda916666e (patch) | |
tree | e9f0279c05fcaf7a4bab890ac72ae088307f30b9 /stylesheets | |
parent | 678e79c2588bfe5cd93425ffadd4147bee3c3bcf (diff) |
HEAD: Stylesheets - reestructured the order of imports and includes.
Added the nonchuk stylesheet from b5_1.
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3681 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'stylesheets')
-rw-r--r-- | stylesheets/lfs-chunked.xsl | 44 | ||||
-rw-r--r-- | stylesheets/lfs-chunked2.xsl | 27 | ||||
-rw-r--r-- | stylesheets/lfs-nochunks.xsl | 29 | ||||
-rw-r--r-- | stylesheets/xhtml/lfs-mixed.xsl | 56 |
4 files changed, 135 insertions, 21 deletions
diff --git a/stylesheets/lfs-chunked.xsl b/stylesheets/lfs-chunked.xsl index b53c78dd7..ce9021a78 100644 --- a/stylesheets/lfs-chunked.xsl +++ b/stylesheets/lfs-chunked.xsl @@ -4,27 +4,31 @@ xmlns="http://www.w3.org/1999/xhtml" version="1.0"> - <!-- We use XHTML --> - <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.65.1/xhtml/chunk.xsl"/> - <xsl:param name="chunker.output.encoding" select="'ISO-8859-1'"/> - - <!-- Including our others customized templates --> - <xsl:include href="xhtml/lfs-admon.xsl"/> - <xsl:include href="xhtml/lfs-index.xsl"/> + <xsl:import href="lfs-chunked2.xsl"/> + <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.65.1/xhtml/chunk-common.xsl"/> + <xsl:include href="http://docbook.sourceforge.net/release/xsl/1.65.1/xhtml/manifest.xsl"/> + + <!-- From the original chunk.xsl file: + + Why is chunk-code now xsl:included? + + Suppose you want to customize *both* the chunking algorithm used *and* the + presentation of some elements that may be chunks. In order to do that, you + must get the order of imports "just right". The answer is to make your own + copy of this file, where you replace the initial import of "docbook.xsl" + with an import of your own base.xsl (that does its own import of docbook.xsl). + + Put the templates for changing the presentation of elements in your base.xsl. + + Put the templates that control chunking after the include of chunk-code.xsl. + + Voila! (Man I hope we can do this better in XSLT 2.0) --> + + <xsl:include href="http://docbook.sourceforge.net/release/xsl/1.65.1/xhtml/chunk-code.xsl"/> + + <!-- Including our others customized chunks templates --> <xsl:include href="xhtml/lfs-legalnotice.xsl"/> - <xsl:include href="xhtml/lfs-mixed.xsl"/> + <xsl:include href="xhtml/lfs-index.xsl"/> <xsl:include href="xhtml/lfs-navigational.xsl"/> - <xsl:include href="xhtml/lfs-titles.xsl"/> - <xsl:include href="xhtml/lfs-toc.xsl"/> - - <!-- The CSS Stylesheet --> - <xsl:param name="html.stylesheet" select="'../stylesheets/lfs.css'"/> - - <!-- Dropping some unwanted style attributes --> - <xsl:param name="ulink.target" select="''"></xsl:param> - <xsl:param name="css.decoration" select="0"></xsl:param> - - <!-- No XML declaration --> - <xsl:param name="chunker.output.omit-xml-declaration" select="'yes'"/> </xsl:stylesheet> diff --git a/stylesheets/lfs-chunked2.xsl b/stylesheets/lfs-chunked2.xsl new file mode 100644 index 000000000..7f0252f01 --- /dev/null +++ b/stylesheets/lfs-chunked2.xsl @@ -0,0 +1,27 @@ +<?xml version='1.0' encoding='ISO-8859-1'?> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns="http://www.w3.org/1999/xhtml" + version="1.0"> + + <!-- We use XHTML --> + <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.65.1/xhtml/docbook.xsl"/> + <xsl:param name="chunker.output.encoding" select="'ISO-8859-1'"/> + + <!-- Including our others customized elements templates --> + <xsl:include href="xhtml/lfs-admon.xsl"/> + <xsl:include href="xhtml/lfs-mixed.xsl"/> + <xsl:include href="xhtml/lfs-titles.xsl"/> + <xsl:include href="xhtml/lfs-toc.xsl"/> + + <!-- The CSS Stylesheet --> + <xsl:param name="html.stylesheet" select="'../stylesheets/lfs.css'"/> + + <!-- Dropping some unwanted style attributes --> + <xsl:param name="ulink.target" select="''"></xsl:param> + <xsl:param name="css.decoration" select="0"></xsl:param> + + <!-- No XML declaration --> + <xsl:param name="chunker.output.omit-xml-declaration" select="'yes'"/> + +</xsl:stylesheet> diff --git a/stylesheets/lfs-nochunks.xsl b/stylesheets/lfs-nochunks.xsl new file mode 100644 index 000000000..41038a992 --- /dev/null +++ b/stylesheets/lfs-nochunks.xsl @@ -0,0 +1,29 @@ +<?xml version='1.0' encoding='ISO-8859-1'?> + +<!-- Version 0.9 - Manuel Canales Esparcia <macana@lfs-es.org> +Based on the original lfs-chunked.xsl created by Matthew Burgess --> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns="http://www.w3.org/1999/xhtml" + version="1.0"> + + <!-- We use XHTML --> + <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.65.1/xhtml/docbook.xsl"/> + + <!-- Including our others customized templates --> + <xsl:include href="xhtml/lfs-admon.xsl"/> + <xsl:include href="xhtml/lfs-index.xsl"/> + <xsl:include href="xhtml/lfs-mixed.xsl"/> + <xsl:include href="xhtml/lfs-navigational.xsl"/> + <!-- The following breaks hyperlinks in the TOC --> + <!-- <xsl:include href="xhtml/lfs-titles.xsl"/> --> + <xsl:include href="xhtml/lfs-toc.xsl"/> + + <!-- The CSS Stylesheet --> + <xsl:param name="html.stylesheet" select="'lfs.css'"/> + + <!-- Dropping some unwanted style attributes --> + <xsl:param name="ulink.target" select="''"></xsl:param> + <xsl:param name="css.decoration" select="0"></xsl:param> + +</xsl:stylesheet> diff --git a/stylesheets/xhtml/lfs-mixed.xsl b/stylesheets/xhtml/lfs-mixed.xsl index 355938549..2d9a3cbfa 100644 --- a/stylesheets/xhtml/lfs-mixed.xsl +++ b/stylesheets/xhtml/lfs-mixed.xsl @@ -50,5 +50,59 @@ </dl> </div> </xsl:template> - + + <!-- Body attributes --> + <xsl:template name="body.attributes"> + <xsl:attribute name="id"> + <xsl:text>lfs</xsl:text> + </xsl:attribute> + <xsl:attribute name="class"> + <xsl:value-of select="substring-after(/book/bookinfo/subtitle, ' ')"/> + </xsl:attribute> + </xsl:template> + + <!-- Sect1 attributes --> + <xsl:template match="sect1"> + <div> + <xsl:choose> + <xsl:when test="@role"> + <xsl:attribute name="class"> + <xsl:value-of select="@role"/> + </xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="class"> + <xsl:value-of select="name(.)"/> + </xsl:attribute> + </xsl:otherwise> + </xsl:choose> + <xsl:call-template name="language.attribute"/> + <xsl:call-template name="sect1.titlepage"/> + <xsl:apply-templates/> + <xsl:call-template name="process.chunk.footnotes"/> + </div> + </xsl:template> + + <!-- Sect2 attributes --> + <xsl:template match="sect2"> + <div> + <xsl:choose> + <xsl:when test="@role"> + <xsl:attribute name="class"> + <xsl:value-of select="@role"/> + </xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="class"> + <xsl:value-of select="name(.)"/> + </xsl:attribute> + </xsl:otherwise> + </xsl:choose> + <xsl:call-template name="language.attribute"/> + <xsl:call-template name="sect2.titlepage"/> + <xsl:apply-templates/> + <xsl:call-template name="process.chunk.footnotes"/> + </div> + </xsl:template> + </xsl:stylesheet> |