Changeset dc931cb for stylesheets


Ignore:
Timestamp:
04/21/2006 08:24:52 PM (18 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
fd8b059
Parents:
962a927
Message:

Automatized preface pages labeling.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@7556 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stylesheets/xhtml/lfs-sections.xsl

    r962a927 rdc931cb  
    4949    </div>
    5050  </xsl:template>
    51    
     51
    5252    <!-- Sections numbering -->
    5353  <xsl:param name="section.autolabel" select="1"/>
    5454  <xsl:param name="section.label.includes.component.label" select="1"/>
    5555
    56     <!-- Skip numeraration for sections with empty title -->
     56    <!-- Use lowercase roman numbers for sect1 in preface -->
     57  <xsl:template match="sect1" mode="label.markup">
     58    <!-- if the parent is a component, maybe label that too -->
     59    <xsl:variable name="parent.is.component">
     60      <xsl:call-template name="is.component">
     61        <xsl:with-param name="node" select=".."/>
     62      </xsl:call-template>
     63    </xsl:variable>
     64    <xsl:variable name="component.label">
     65      <xsl:if test="$section.label.includes.component.label != 0
     66                    and $parent.is.component != 0">
     67        <xsl:variable name="parent.label">
     68          <xsl:apply-templates select=".." mode="label.markup"/>
     69        </xsl:variable>
     70        <xsl:if test="$parent.label != ''">
     71          <xsl:apply-templates select=".." mode="label.markup"/>
     72          <xsl:apply-templates select=".." mode="intralabel.punctuation"/>
     73        </xsl:if>
     74      </xsl:if>
     75    </xsl:variable>
     76    <xsl:choose>
     77      <xsl:when test="@label">
     78        <xsl:value-of select="@label"/>
     79      </xsl:when>
     80      <xsl:when test="$section.autolabel != 0">
     81        <xsl:copy-of select="$component.label"/>
     82        <xsl:choose>
     83          <xsl:when test="ancestor::preface">
     84            <xsl:number format="i" count="sect1"/>
     85          </xsl:when>
     86          <xsl:otherwise>
     87            <xsl:number format="1" count="sect1"/>
     88          </xsl:otherwise>
     89        </xsl:choose>
     90      </xsl:when>
     91    </xsl:choose>
     92  </xsl:template>
     93
     94    <!-- Skip numeration for sect2 with empty title -->
    5795  <xsl:template match="sect2|sect3|sect4|sect5" mode="label.markup">
    5896    <xsl:if test="string-length(title) > 0">
Note: See TracChangeset for help on using the changeset viewer.