Changeset 037ab68 for stylesheets


Ignore:
Timestamp:
05/14/2006 11:45:19 AM (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:
9b04fe8
Parents:
b4a71ef
Message:

Moved packages.xml info to packages.ent.
Automatized total packages size calculation.

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

File:
1 edited

Legend:

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

    rb4a71ef r037ab68  
    44                xmlns="http://www.w3.org/1999/xhtml"
    55                version="1.0">
     6
     7    <!-- para -->
     8  <xsl:template match="para">
     9    <xsl:choose>
     10      <xsl:when test="child::ulink[@url=' ']"/>
     11      <xsl:otherwise>
     12        <xsl:call-template name="paragraph">
     13          <xsl:with-param name="class">
     14            <xsl:if test="@role and $para.propagates.style != 0">
     15              <xsl:value-of select="@role"/>
     16            </xsl:if>
     17          </xsl:with-param>
     18          <xsl:with-param name="content">
     19            <xsl:if test="position() = 1 and parent::listitem">
     20              <xsl:call-template name="anchor">
     21                <xsl:with-param name="node" select="parent::listitem"/>
     22              </xsl:call-template>
     23            </xsl:if>
     24            <xsl:call-template name="anchor"/>
     25            <xsl:apply-templates/>
     26          </xsl:with-param>
     27        </xsl:call-template>
     28      </xsl:otherwise>
     29    </xsl:choose>
     30  </xsl:template>
    631
    732    <!-- screen -->
     
    2045    </xsl:choose>
    2146  </xsl:template>
    22  
     47
    2348  <xsl:template match="userinput">
    2449    <xsl:choose>
     
    5580  </xsl:template>
    5681
    57  
     82
    5883  <!-- variablelist -->
    5984  <xsl:template match="variablelist">
     
    6994    </xsl:choose>
    7095  </xsl:template>
    71  
     96
    7297
    7398    <!-- Body attributes -->
     
    102127    </a>
    103128  </xsl:template>
    104  
     129
    105130    <!-- The <code> xhtml tag have look issues in some browsers, like Konqueror and.
    106131      isn't semantically correct (a filename isn't a code fragment) We will use <tt> for now. -->
     
    123148    </tt>
    124149  </xsl:template>
    125  
     150
    126151  <xsl:template name="inline.boldmonoseq">
    127152    <xsl:param name="content">
     
    136161    <!-- or other titles that may already be represented with <strong>'s. -->
    137162    <xsl:choose>
    138       <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure' 
     163      <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure'
    139164              or local-name(../..) = 'example' or local-name(../..) = 'table' or local-name(../..) = 'formalpara')">
    140165        <tt class="{local-name(.)}">
     
    161186    </xsl:choose>
    162187  </xsl:template>
    163  
     188
    164189  <xsl:template name="inline.italicmonoseq">
    165190    <xsl:param name="content">
     
    183208  </xsl:template>
    184209
     210    <!-- Total packages size calculation -->
     211  <xsl:template match="returnvalue">
     212    <xsl:call-template name="calculation">
     213     <xsl:with-param name="scope" select="../../variablelist"/>
     214    </xsl:call-template>
     215  </xsl:template>
     216
     217  <xsl:template name="calculation">
     218    <xsl:param name="scope"/>
     219    <xsl:param name="total">0</xsl:param>
     220    <xsl:param name="position">1</xsl:param>
     221    <xsl:variable name="tokens" select="count($scope/varlistentry)"/>
     222    <xsl:variable name="token" select="$scope/varlistentry[$position]/term/token"/>
     223    <xsl:variable name="size" select="substring-before($token,' KB')"/>
     224    <xsl:variable name="rawsize">
     225      <xsl:choose>
     226        <xsl:when test="contains($size,',')">
     227          <xsl:value-of select="concat(substring-before($size,','),substring-after($size,','))"/>
     228        </xsl:when>
     229        <xsl:otherwise>
     230          <xsl:value-of select="$size"/>
     231        </xsl:otherwise>
     232      </xsl:choose>
     233    </xsl:variable>
     234    <xsl:choose>
     235      <xsl:when test="$position &lt;= $tokens">
     236        <xsl:call-template name="calculation">
     237          <xsl:with-param name="scope" select="$scope"/>
     238          <xsl:with-param name="position" select="$position +1"/>
     239          <xsl:with-param name="total" select="$total + $rawsize"/>
     240        </xsl:call-template>
     241      </xsl:when>
     242      <xsl:otherwise>
     243        <xsl:choose>
     244          <xsl:when test="$total &lt; '1000'">
     245            <xsl:value-of select="$total"/>
     246            <xsl:text>  KB</xsl:text>
     247          </xsl:when>
     248          <xsl:when test="$total &gt; '1000' and $total &lt; '5000'">
     249            <xsl:value-of select="substring($total,1,1)"/>
     250            <xsl:text>,</xsl:text>
     251            <xsl:value-of select="substring($total,2)"/>
     252            <xsl:text>  KB</xsl:text>
     253          </xsl:when>
     254          <xsl:otherwise>
     255            <xsl:value-of select="round($total div 1024)"/>
     256            <xsl:text>  MB</xsl:text>
     257          </xsl:otherwise>
     258        </xsl:choose>
     259      </xsl:otherwise>
     260    </xsl:choose>
     261  </xsl:template>
     262
    185263
    186264</xsl:stylesheet>
Note: See TracChangeset for help on using the changeset viewer.