Author: pierre
Date: Fri Sep 13 10:00:08 2019
New Revision: 22137

Log:
Allows using system docbook-xsl stylesheets:
- with a slight change of the css stylesheet, allows having the glossary
  title in the same style as the others
- tested with docbook-xsl 1.78.1, 1.79.1, 1.79.2

Deleted:
   trunk/BOOK/stylesheets/lfs-xsl/docbook-xsl-snapshot/
Modified:
   trunk/BOOK/Makefile
   trunk/BOOK/stylesheets/lfs-xsl/chunk-master.xsl
   trunk/BOOK/stylesheets/lfs-xsl/chunk-slave.xsl
   trunk/BOOK/stylesheets/lfs-xsl/lfs.css
   trunk/BOOK/stylesheets/lfs-xsl/nochunks.xsl
   trunk/BOOK/stylesheets/lfs-xsl/pdf.xsl
   trunk/BOOK/stylesheets/lfs-xsl/profile.xsl
   trunk/BOOK/stylesheets/lfs-xsl/xhtml/lfs-index.xsl

Modified: trunk/BOOK/Makefile
==============================================================================
--- trunk/BOOK/Makefile Fri Sep 13 08:58:02 2019        (r22136)
+++ trunk/BOOK/Makefile Fri Sep 13 10:00:08 2019        (r22137)
@@ -76,8 +76,7 @@
    fi;
        $(Q)cp images/*.png $(BASEDIR)/images
 
-       $(Q)cd $(BASEDIR)/; sed -e "s@../stylesheets@stylesheets@g" \
-                           -e "s@../images@images@g"           \
+       $(Q)cd $(BASEDIR)/; sed -e "s@../images@images@g"           \
                            -i *.html
 
        @echo "Running Tidy and obfuscate.sh on chunked XHTML..."

Modified: trunk/BOOK/stylesheets/lfs-xsl/chunk-master.xsl
==============================================================================
--- trunk/BOOK/stylesheets/lfs-xsl/chunk-master.xsl     Fri Sep 13 08:58:02 
2019        (r22136)
+++ trunk/BOOK/stylesheets/lfs-xsl/chunk-master.xsl     Fri Sep 13 10:00:08 
2019        (r22137)
@@ -18,10 +18,10 @@
   <xsl:import href="chunk-slave.xsl"/>
 
     <!-- Upstream chunk code named templates -->
-  <xsl:import href="docbook-xsl-snapshot/xhtml/chunk-common.xsl"/>
+  <xsl:import 
href="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk-common.xsl"/>
 
     <!-- Upstream chunk code match templates -->
-  <xsl:include href="docbook-xsl-snapshot/xhtml/chunk-code.xsl"/>
+  <xsl:include 
href="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk-code.xsl"/>
 
     <!-- Including our customized chunks templates -->
   <xsl:include href="xhtml/lfs-index.xsl"/>

Modified: trunk/BOOK/stylesheets/lfs-xsl/chunk-slave.xsl
==============================================================================
--- trunk/BOOK/stylesheets/lfs-xsl/chunk-slave.xsl      Fri Sep 13 08:58:02 
2019        (r22136)
+++ trunk/BOOK/stylesheets/lfs-xsl/chunk-slave.xsl      Fri Sep 13 10:00:08 
2019        (r22137)
@@ -13,7 +13,7 @@
         Sets global params and include customized elements templates. -->
 
     <!-- Upstream XHTML presentation templates -->
-  <xsl:import href="docbook-xsl-snapshot/xhtml/docbook.xsl"/>
+  <xsl:import 
href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"/>
 
     <!-- Use ISO-8859-1 for output instead of default UTF-8 -->
   <xsl:param name="chunker.output.encoding" select="'ISO-8859-1'"/>
@@ -27,13 +27,13 @@
   <xsl:include href="xhtml/lfs-toc.xsl"/>
   <xsl:include href="xhtml/lfs-xref.xsl"/>
 
-    <!-- The CSS Stylesheets. We set here relative path from sub-dirs HTML 
files.
-    The path from top-level HTML files (index.html, partX.html, etc) MUST be
-    fixed via a sed in the Makefile-->
-    <!-- Master CSS Stylesheet -->
-  <xsl:param name="html.stylesheet" select="'../stylesheets/lfs.css'"/>
-    <!-- Print CSS Stylesheet -->
-    <!-- The original template is in {docbook-xsl}/xhtml/docbook.xsl -->
+  <!-- The CSS Stylesheets. The path is relative to the top level html
+       directory. The templates compute automatically the position of
+       the CSS relative to the current file. So no need to fix the paths
+       in the Makefile. -->
+  <xsl:param name="html.stylesheet" select="'stylesheets/lfs.css'"/>
+    <!-- Print CSS Stylesheet
+    The original template is in {docbook-xsl}/xhtml/docbook.xsl -->
   <xsl:template name='user.head.content'>
      <link rel="stylesheet" href="../stylesheets/lfs-print.css" 
type="text/css" media="print"/>
   </xsl:template>

Modified: trunk/BOOK/stylesheets/lfs-xsl/lfs.css
==============================================================================
--- trunk/BOOK/stylesheets/lfs-xsl/lfs.css      Fri Sep 13 08:58:02 2019        
(r22136)
+++ trunk/BOOK/stylesheets/lfs-xsl/lfs.css      Fri Sep 13 10:00:08 2019        
(r22137)
@@ -90,7 +90,7 @@
   padding: 0.4em;
 }
 
-.preface h1, .part h1, .chapter h1, .appendix h1, .index h1, .sect1 h1 {
+.preface h1, .part h1, .chapter h1, .appendix h1, .index h1, .sect1 h1, 
.glossary h1 {
   background: #f5f6f7;
   border-bottom: .1em solid #dbddec;
   margin-bottom: 1em;

Modified: trunk/BOOK/stylesheets/lfs-xsl/nochunks.xsl
==============================================================================
--- trunk/BOOK/stylesheets/lfs-xsl/nochunks.xsl Fri Sep 13 08:58:02 2019        
(r22136)
+++ trunk/BOOK/stylesheets/lfs-xsl/nochunks.xsl Fri Sep 13 10:00:08 2019        
(r22137)
@@ -13,7 +13,7 @@
         Replaces {docbook-xsl}/xhtml/profile-docbook.xsl -->
 
     <!-- Upstream XHTML templates -->
-  <xsl:import href="docbook-xsl-snapshot/xhtml/docbook.xsl"/>
+  <xsl:import 
href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"/>
 
     <!-- Fix encoding issues with default UTF-8 output of the xhtml stylesheet 
-->
   <xsl:output method="html" encoding="ISO-8859-1" indent="no" />

Modified: trunk/BOOK/stylesheets/lfs-xsl/pdf.xsl
==============================================================================
--- trunk/BOOK/stylesheets/lfs-xsl/pdf.xsl      Fri Sep 13 08:58:02 2019        
(r22136)
+++ trunk/BOOK/stylesheets/lfs-xsl/pdf.xsl      Fri Sep 13 10:00:08 2019        
(r22137)
@@ -14,7 +14,7 @@
 
     <!-- Upstream FO templates. Profiled version is not supported by
          xsltproc, thus pofiling must be done in two steps (see Makefile) -->
-  <xsl:import href="docbook-xsl-snapshot/fo/docbook.xsl"/>
+  <xsl:import 
href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
 
     <!-- Uncomment the next for debugging the raw FO code.
          Note that FOP will complaints about a lot of paragraph overflows

Modified: trunk/BOOK/stylesheets/lfs-xsl/profile.xsl
==============================================================================
--- trunk/BOOK/stylesheets/lfs-xsl/profile.xsl  Fri Sep 13 08:58:02 2019        
(r22136)
+++ trunk/BOOK/stylesheets/lfs-xsl/profile.xsl  Fri Sep 13 10:00:08 2019        
(r22137)
@@ -12,11 +12,11 @@
        Replaces {docbook-xsl}/profiling/profile.xsl -->
 
   <!-- Include common profiling stylesheet -->
-  <xsl:import href="docbook-xsl-snapshot/profiling/profile-mode.xsl"/>
+  <xsl:import 
href="http://docbook.sourceforge.net/release/xsl/current/profiling/profile-mode.xsl"/>
 
     <!-- This file must be included, because profile-mode is using
          templates from it -->
-  <xsl:import href="docbook-xsl-snapshot/common/stripns.xsl"/>
+  <xsl:import 
href="http://docbook.sourceforge.net/release/xsl/current/common/stripns.xsl"/>
 
     <!-- In the two pass processing there is no need for base URI fixup -->
   <xsl:param name="profile.baseuri.fixup" select="false()"/>

Modified: trunk/BOOK/stylesheets/lfs-xsl/xhtml/lfs-index.xsl
==============================================================================
--- trunk/BOOK/stylesheets/lfs-xsl/xhtml/lfs-index.xsl  Fri Sep 13 08:58:02 
2019        (r22136)
+++ trunk/BOOK/stylesheets/lfs-xsl/xhtml/lfs-index.xsl  Fri Sep 13 10:00:08 
2019        (r22137)
@@ -35,17 +35,18 @@
     <xsl:text>longindex.html</xsl:text>
   </xsl:template>
 
-    <!-- The Index title in the longindex.html page:
-           Removed a lot of code not useful for us.
-           Forced h1 title size. -->
-    <!-- The original template is in 
{docbook-xsl}/xhtml/titlepage.templates.xsl -->
+  <!-- The Index title in the longindex.html page:
+         Removed a lot of code not useful for us.
+         Forced h1 title size.
+       The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl
+  Use the original template now (as in LFS)
   <xsl:template name="index.titlepage">
     <h1 class="index">
       <xsl:call-template name="gentext">
         <xsl:with-param name="key" select="$index-title"/>
       </xsl:call-template>
     </h1>
-  </xsl:template>
+  </xsl:template>-->
 
     <!--Divisions:
           Translate alphabetical divisions titles to by-type titles.
@@ -131,28 +132,14 @@
         </h2>
       </xsl:if>
       <ul>
-        <xsl:apply-templates select="key('letter', $key)[&scope;] 
[count(.|key('primary', &primary;)[&scope;][1])=1]"
-                              mode="index-primary">
-          <xsl:with-param name="scope" select="$scope"/>
-          <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
-        </xsl:apply-templates>
+      <xsl:apply-templates select="key('letter', 
$key)[count(ancestor::node()|$scope) = 
count(ancestor::node())][count(.|key('primary', 
normalize-space(concat(primary/@sortas, &quot; &quot;, 
primary)))[count(ancestor::node()|$scope) = count(ancestor::node())][1])=1]" 
mode="index-primary">
+        <xsl:with-param name="scope" select="$scope"/>
+        <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
+      </xsl:apply-templates>
       </ul>
     </xsl:if>
   </xsl:template>
 
-    <!-- Dropping $term.separator and $number.separator from here.
-         We add our customized ones in the output flow.
-         As all our indexterm have @zone attributes, removed a lot of
-         unused code. -->
-    <!-- The original template is in {docbook-xsl}/xhtml/autoidx.xsl -->
-  <xsl:template match="indexterm" mode="reference">
-    <xsl:param name="scope" select="."/>
-    <xsl:call-template name="reference">
-      <xsl:with-param name="zones" select="normalize-space(@zone)"/>
-      <xsl:with-param name="scope" select="$scope"/>
-    </xsl:call-template>
-  </xsl:template>
-
     <!-- Primary items:
            Changed the output format from dl to ul.
            Placed the term and separator into strong tags.
@@ -161,8 +148,8 @@
     <!-- The original template is in {docbook-xsl}/xhtml/autoidx.xsl -->
   <xsl:template match="indexterm" mode="index-primary">
     <xsl:param name="scope" select="."/>
-    <xsl:variable name="key" select="&primary;"/>
-    <xsl:variable name="refs" select="key('primary', $key)[&scope;]"/>
+    <xsl:variable name="key" select="normalize-space(concat(primary/@sortas, 
&quot; &quot;, primary))"/>
+    <xsl:variable name="refs" select="key('primary', 
$key)[count(ancestor::node()|$scope) = count(ancestor::node())]"/>
     <li>
       <strong class="item">
         <xsl:value-of select="primary"/>
@@ -177,8 +164,7 @@
       </span>
       <xsl:if test="$refs/secondary">
         <ul>
-          <xsl:apply-templates select="$refs[secondary and 
count(.|key('secondary', concat($key, &sep;, &secondary;))[&scope;][1]) = 1]"
-                               mode="index-secondary">
+          <xsl:apply-templates select="$refs[secondary and 
count(.|key('secondary', concat($key, &quot; &quot;, 
normalize-space(concat(secondary/@sortas, &quot; &quot;, 
secondary))))[count(ancestor::node()|$scope) = count(ancestor::node()) ][1]) = 
1]" mode="index-secondary">
             <xsl:with-param name="scope" select="$scope"/>
             <xsl:sort select="translate(&secondary;, &lowercase;, 
&uppercase;)"/>
           </xsl:apply-templates>
@@ -195,8 +181,8 @@
     <!-- The original template is in {docbook-xsl}/xhtml/autoidx.xsl -->
   <xsl:template match="indexterm" mode="index-secondary">
     <xsl:param name="scope" select="."/>
-    <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;)"/>
-    <xsl:variable name="refs" select="key('secondary', $key)[&scope;]"/>
+    <xsl:variable name="key" 
select="concat(normalize-space(concat(primary/@sortas, &quot; &quot;, 
primary)), &quot; &quot;, normalize-space(concat(secondary/@sortas, &quot; 
&quot;, secondary)))"/>
+    <xsl:variable name="refs" select="key('secondary', 
$key)[count(ancestor::node()|$scope) = count(ancestor::node())]"/>
     <li>
       <strong class="secitem">
         <xsl:value-of select="secondary"/>
@@ -212,14 +198,27 @@
     </li>
   </xsl:template>
 
-    <!-- The target links:
-           Changed links separator.
-           On the second @zone link, we use a fixed string for the text
-           with gentext support.
-           Assume that there is no more than 2 @zone in a indexterm.
-           Use href.target.uri named template to resolve the links. It is 
faster
-           than the default href.target named template. -->
-    <!-- The original template is in {docbook-xsl}/xhtml/autoidx.xsl -->
+  <!-- Drop $term.separator and $number.separator from here as customized ones
+       are added in the output flow.
+       As all the indexterms in the book have @zone attributes, removed a lot 
of
+       unused code.
+       The original template is in {docbook-xsl}/xhtml/autoidx.xsl -->
+  <xsl:template match="indexterm" mode="reference">
+    <xsl:param name="scope" select="."/>
+    <xsl:call-template name="reference">
+      <xsl:with-param name="zones" select="normalize-space(@zone)"/>
+      <xsl:with-param name="scope" select="$scope"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <!-- The target links:
+       Changed link separator
+       On the second @zone link, we use a fixed string for the text with 
gentext
+       support.
+       Assume that there are no more than 2 @zone in a indexterm.
+       Use href.target.uri named template to resolve the links. It is faster
+       than the default href.target named template.
+       The original template is in {docbook-xsl}/xhtml/autoidx.xsl -->
   <xsl:template name="reference">
     <xsl:param name="scope" select="."/>
     <xsl:param name="zones"/>
-- 
http://lists.linuxfromscratch.org/listinfo/blfs-book
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to