mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-01-19 13:37:39 +00:00
a34ad80e86
Added the nonchuk stylesheet from b5_1. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3681 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
109 lines
2.9 KiB
XML
109 lines
2.9 KiB
XML
<?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">
|
|
|
|
<!-- screen -->
|
|
<xsl:template match="screen">
|
|
<xsl:choose>
|
|
<!-- Temporally hack -->
|
|
<xsl:when test="child::* = userinput">
|
|
<pre class="{name(.)}">
|
|
<kbd class="command">
|
|
<xsl:value-of select="."/>
|
|
</kbd>
|
|
</pre>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<pre class="{name(.)}">
|
|
<xsl:apply-templates/>
|
|
</pre>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
|
|
<!-- variablelist -->
|
|
<xsl:template match="variablelist">
|
|
<div class="{name(.)}">
|
|
<xsl:if test="title">
|
|
<xsl:choose>
|
|
<xsl:when test="@role = 'materials'">
|
|
<h2>
|
|
<xsl:value-of select="title"/>
|
|
</h2>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<h3>
|
|
<xsl:value-of select="title"/>
|
|
</h3>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:if>
|
|
<dl>
|
|
<xsl:if test="@role">
|
|
<xsl:attribute name="class">
|
|
<xsl:value-of select="@role"/>
|
|
</xsl:attribute>
|
|
</xsl:if>
|
|
<xsl:apply-templates select="varlistentry"/>
|
|
</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>
|