r8165 - in branches/new-xsl: . xhtml

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Thu Jun 14 13:07:24 PDT 2007


Author: manuel
Date: 2007-06-14 14:07:24 -0600 (Thu, 14 Jun 2007)
New Revision: 8165

Modified:
   branches/new-xsl/lfs.css
   branches/new-xsl/xhtml/lfs-admon.xsl
   branches/new-xsl/xhtml/lfs-index.xsl
   branches/new-xsl/xhtml/lfs-mixed.xsl
   branches/new-xsl/xhtml/lfs-navigational.xsl
   branches/new-xsl/xhtml/lfs-titles.xsl
Log:
Cleaned XHTML output code.

Modified: branches/new-xsl/lfs.css
===================================================================
--- branches/new-xsl/lfs.css	2007-06-12 20:51:30 UTC (rev 8164)
+++ branches/new-xsl/lfs.css	2007-06-14 20:07:24 UTC (rev 8165)
@@ -34,15 +34,11 @@
   padding: 0;
 }
 
-div.dedication .titlepage {
-  background: #fff;
+div.dedication {
+  padding-left: 1em;
 }
 
-div.dedication p {
-  padding-left: 2em;
-}
 
-
 /* Sections */
 div.sect1, div.appendix {
   padding-left: .3em;
@@ -158,13 +154,13 @@
   border-top: 1px solid #dbddec;
 }
 
-div.headertitles h4 {
+div.navheader h4 {
   margin-top: .4em;
   margin-bottom: 0;
   text-align: center;
 }
 
-div.headertitles h3 {
+div.navheader h3 {
   margin-top: .2em;
   margin-bottom: 0;
   text-align: center;
@@ -264,6 +260,10 @@
     float: left;
 }
 
+.indexref {
+    display: block;
+}
+
 .item + .indexref {
     margin-left: 31em;
 }
@@ -274,6 +274,23 @@
 
 
 /* Admonitions */
+div.admon img {
+  padding: .3em;
+}
+
+div.admon h3 {
+  display: inline;
+  margin-left: 2em;
+}
+
+div.admon p {
+  margin-left: .5em;
+}
+
+div.admon pre {
+  margin: 0.5em 3em;
+}
+
 div.note, div.tip {
   background-color: #fffff6;
   border: 2px solid #dbddec;
@@ -293,19 +310,6 @@
   color: #900;
 }
 
-div.admonhead img {
-  padding: .3em;
-}
-
-div.admonhead h3 {
-  display: inline;
-  margin-left: 1.5em;
-}
-
-div.admonbody {
-  margin: .5em;
-}
-
 div.important em, div.warning em, div.caution em {
   color: #000;
   font-weight: bold;
@@ -329,16 +333,16 @@
   text-align: left;
 }
 
-div.revhistory {
+.revhistory {
   padding-left: 1em;
 }
 
-div.revhistory th {
+.revhistory th {
   line-height: 2em;
   text-align: left;
 }
 
-div.revhistory td {
+.revhistory td {
   padding-right: 1em;
 }
 

Modified: branches/new-xsl/xhtml/lfs-admon.xsl
===================================================================
--- branches/new-xsl/xhtml/lfs-admon.xsl	2007-06-12 20:51:30 UTC (rev 8164)
+++ branches/new-xsl/xhtml/lfs-admon.xsl	2007-06-14 20:07:24 UTC (rev 8165)
@@ -38,20 +38,16 @@
         <xsl:with-param name="key" select="$admon.type"/>
       </xsl:call-template>
     </xsl:variable>
-    <div class="{name(.)}">
-      <div class ="admonhead">
-        <img alt="[{$alt}]">
-          <xsl:attribute name="src">
-            <xsl:call-template name="admon.graphic"/>
-          </xsl:attribute>
-        </img>
-        <h3 class="admontitle">
-          <xsl:apply-templates select="." mode="object.title.markup"/>
-        </h3>
-      </div>
-      <div class="admonbody">
-        <xsl:apply-templates/>
-      </div>
+    <div class="admon {name(.)}">
+      <img alt="[{$alt}]">
+        <xsl:attribute name="src">
+          <xsl:call-template name="admon.graphic"/>
+        </xsl:attribute>
+      </img>
+      <h3>
+        <xsl:apply-templates select="." mode="object.title.markup"/>
+      </h3>
+      <xsl:apply-templates/>
     </div>
   </xsl:template>
 

Modified: branches/new-xsl/xhtml/lfs-index.xsl
===================================================================
--- branches/new-xsl/xhtml/lfs-index.xsl	2007-06-12 20:51:30 UTC (rev 8164)
+++ branches/new-xsl/xhtml/lfs-index.xsl	2007-06-14 20:07:24 UTC (rev 8165)
@@ -34,13 +34,11 @@
            Forced h1 title size. -->
     <!-- The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl -->
   <xsl:template name="index.titlepage">
-    <div class="titlepage">
-      <h1 class="index">
-        <xsl:call-template name="gentext">
-          <xsl:with-param name="key" select="$index-title"/>
-        </xsl:call-template>
-      </h1>
-    </div>
+    <h1 class="index">
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="$index-title"/>
+      </xsl:call-template>
+    </h1>
   </xsl:template>
 
     <!--Divisions:
@@ -55,86 +53,84 @@
     <xsl:variable name="divtitle" select="translate($key, &lowercase;, &uppercase;)"/>
       <!-- Make sure that we don't generate a div if there are no terms in scope -->
     <xsl:if test="key('letter', $key)[&scope;] [count(.|key('primary', &primary;)[&scope;][1]) = 1]">
-      <div class="indexdiv">
-        <xsl:if test="contains(concat(&lowercase;, &uppercase;), $key)">
-          <h2>
-            <xsl:choose>
-              <xsl:when test="$divtitle = 'A'">
-                <a id="package-index" name="package-index"/>
-                <xsl:call-template name="gentext">
-                  <xsl:with-param name="key">Packages</xsl:with-param>
-                </xsl:call-template>
-              </xsl:when>
-              <xsl:when test="$divtitle = 'B'">
-                <a id="program-index" name="program-index"/>
-                <xsl:call-template name="gentext">
-                  <xsl:with-param name="key">Programs</xsl:with-param>
-                </xsl:call-template>
-              </xsl:when>
-              <xsl:when test="$divtitle = 'C'">
-                <a id="library-index" name="library-index"/>
-                <xsl:call-template name="gentext">
-                  <xsl:with-param name="key">Libraries</xsl:with-param>
-                </xsl:call-template>
-              </xsl:when>
-              <xsl:when test="$divtitle = 'D'">
-                <xsl:choose>
-                  <xsl:when test="$book-type = 'blfs'">
-                    <a id="kernel-config-index" name="kernel-config-index"/>
-                    <xsl:call-template name="gentext">
-                      <xsl:with-param name="key">Kernel Configuration</xsl:with-param>
-                    </xsl:call-template>
-                  </xsl:when>
-                  <xsl:otherwise>
-                    <a id="scripts-index" name="scripts-index"/>
-                    <xsl:call-template name="gentext">
-                      <xsl:with-param name="key">Scripts</xsl:with-param>
-                    </xsl:call-template>
-                  </xsl:otherwise>
-                </xsl:choose>
-              </xsl:when>
-              <xsl:when test="$divtitle = 'E'">
-                <xsl:choose>
-                  <xsl:when test="$book-type = 'blfs'">
-                    <a id="config-file-index" name="config-file-index"/>
-                    <xsl:call-template name="gentext">
-                      <xsl:with-param name="key">Configuration Files</xsl:with-param>
-                    </xsl:call-template>
-                  </xsl:when>
-                  <xsl:otherwise>
-                    <a id="other-index" name="other-index"/>
-                    <xsl:call-template name="gentext">
-                      <xsl:with-param name="key">Others</xsl:with-param>
-                    </xsl:call-template>
-                  </xsl:otherwise>
-                </xsl:choose>
-              </xsl:when>
-              <xsl:when test="$divtitle = 'F'">
-                  <a id="bootscript-index" name="bootscript-index"/>
+      <xsl:if test="contains(concat(&lowercase;, &uppercase;), $key)">
+        <h2>
+          <xsl:choose>
+            <xsl:when test="$divtitle = 'A'">
+              <a id="package-index" name="package-index"/>
+              <xsl:call-template name="gentext">
+                <xsl:with-param name="key">Packages</xsl:with-param>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$divtitle = 'B'">
+              <a id="program-index" name="program-index"/>
+              <xsl:call-template name="gentext">
+                <xsl:with-param name="key">Programs</xsl:with-param>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$divtitle = 'C'">
+              <a id="library-index" name="library-index"/>
+              <xsl:call-template name="gentext">
+                <xsl:with-param name="key">Libraries</xsl:with-param>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$divtitle = 'D'">
+              <xsl:choose>
+                <xsl:when test="$book-type = 'blfs'">
+                  <a id="kernel-config-index" name="kernel-config-index"/>
                   <xsl:call-template name="gentext">
-                    <xsl:with-param name="key">Bootscripts</xsl:with-param>
+                    <xsl:with-param name="key">Kernel Configuration</xsl:with-param>
                   </xsl:call-template>
-              </xsl:when>
-              <xsl:when test="$divtitle = 'G'">
-                <a id="other-index" name="other-index"/>
+                </xsl:when>
+                <xsl:otherwise>
+                  <a id="scripts-index" name="scripts-index"/>
+                  <xsl:call-template name="gentext">
+                    <xsl:with-param name="key">Scripts</xsl:with-param>
+                  </xsl:call-template>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:when>
+            <xsl:when test="$divtitle = 'E'">
+              <xsl:choose>
+                <xsl:when test="$book-type = 'blfs'">
+                  <a id="config-file-index" name="config-file-index"/>
+                  <xsl:call-template name="gentext">
+                    <xsl:with-param name="key">Configuration Files</xsl:with-param>
+                  </xsl:call-template>
+                </xsl:when>
+                <xsl:otherwise>
+                  <a id="other-index" name="other-index"/>
+                  <xsl:call-template name="gentext">
+                    <xsl:with-param name="key">Others</xsl:with-param>
+                  </xsl:call-template>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:when>
+            <xsl:when test="$divtitle = 'F'">
+                <a id="bootscript-index" name="bootscript-index"/>
                 <xsl:call-template name="gentext">
-                  <xsl:with-param name="key">Others</xsl:with-param>
+                  <xsl:with-param name="key">Bootscripts</xsl:with-param>
                 </xsl:call-template>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:value-of select="$divtitle"/>
-              </xsl:otherwise>
-            </xsl:choose>
-          </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>
-        </ul>
-      </div>
+            </xsl:when>
+            <xsl:when test="$divtitle = 'G'">
+              <a id="other-index" name="other-index"/>
+              <xsl:call-template name="gentext">
+                <xsl:with-param name="key">Others</xsl:with-param>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="$divtitle"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </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>
+      </ul>
     </xsl:if>
   </xsl:template>
 
@@ -166,13 +162,13 @@
         <xsl:value-of select="primary"/>
         <xsl:text>: </xsl:text>
       </strong>
-      <div class='indexref'>
+      <span class='indexref'>
         <xsl:for-each select="$refs[generate-id() = generate-id(key('primary-section',concat($key, &sep;, &section.id;))[&scope;][1])]">
           <xsl:apply-templates select="." mode="reference">
             <xsl:with-param name="scope" select="$scope"/>
           </xsl:apply-templates>
         </xsl:for-each>
-      </div>
+      </span>
       <xsl:if test="$refs/secondary">
         <ul>
           <xsl:apply-templates select="$refs[secondary and count(.|key('secondary', concat($key, &sep;, &secondary;))[&scope;][1]) = 1]"
@@ -200,13 +196,13 @@
         <xsl:value-of select="secondary"/>
         <xsl:text>: </xsl:text>
       </strong>
-      <div class='indexref'>
+      <span class='indexref'>
         <xsl:for-each select="$refs[generate-id() = generate-id(key('secondary-section', concat($key, &sep;, &section.id;))[&scope;][1])]">
           <xsl:apply-templates select="." mode="reference">
             <xsl:with-param name="scope" select="$scope"/>
           </xsl:apply-templates>
         </xsl:for-each>
-      </div>
+      </span>
     </li>
   </xsl:template>
 

Modified: branches/new-xsl/xhtml/lfs-mixed.xsl
===================================================================
--- branches/new-xsl/xhtml/lfs-mixed.xsl	2007-06-12 20:51:30 UTC (rev 8164)
+++ branches/new-xsl/xhtml/lfs-mixed.xsl	2007-06-14 20:07:24 UTC (rev 8165)
@@ -244,20 +244,18 @@
       </xsl:call-template>
     </xsl:variable>
     <xsl:variable name="contents">
-      <div class="{name(.)}">
-        <table summary="{$title}">
-          <tr>
-            <th colspan="{$numcols}">
-              <b>
-                <xsl:value-of select="$title"/>
-              </b>
-            </th>
-          </tr>
-          <xsl:apply-templates mode="titlepage.mode">
-            <xsl:with-param name="numcols" select="$numcols"/>
-          </xsl:apply-templates>
-        </table>
-      </div>
+      <table summary="{$title}" class="{name(.)}">
+        <tr>
+          <th colspan="{$numcols}">
+            <b>
+              <xsl:value-of select="$title"/>
+            </b>
+          </th>
+        </tr>
+        <xsl:apply-templates mode="titlepage.mode">
+          <xsl:with-param name="numcols" select="$numcols"/>
+        </xsl:apply-templates>
+      </table>
     </xsl:variable>
     <xsl:copy-of select="$contents"/>
   </xsl:template>

Modified: branches/new-xsl/xhtml/lfs-navigational.xsl
===================================================================
--- branches/new-xsl/xhtml/lfs-navigational.xsl	2007-06-12 20:51:30 UTC (rev 8164)
+++ branches/new-xsl/xhtml/lfs-navigational.xsl	2007-06-14 20:07:24 UTC (rev 8165)
@@ -29,21 +29,18 @@
       <!-- Don't generate the header in index.html -->
     <xsl:if test="$home != .">
       <div class="navheader">
-          <!-- Add common titles -->
-        <div class="headertitles">
-           <!-- Book title and version -->
-          <h4>
-            <xsl:apply-templates select="$home" mode="object.title.markup"/>
-            <xsl:text> - </xsl:text>
-            <xsl:apply-templates select="$home" mode="object.subtitle.markup"/>
-          </h4>
-            <!-- Except for preface, part, and index, add the title of the parent -->
-          <xsl:if test="$up != $home">
-            <h3>
-              <xsl:apply-templates select="$up" mode="object.title.markup"/>
-            </h3>
-          </xsl:if>
-        </div>
+          <!-- Book title and version -->
+        <h4>
+          <xsl:apply-templates select="$home" mode="object.title.markup"/>
+          <xsl:text> - </xsl:text>
+          <xsl:apply-templates select="$home" mode="object.subtitle.markup"/>
+        </h4>
+          <!-- Except for preface, part, and index, add the title of the parent -->
+        <xsl:if test="$up != $home">
+          <h3>
+            <xsl:apply-templates select="$up" mode="object.title.markup"/>
+          </h3>
+        </xsl:if>
           <!-- Create header navigational links -->
         <xsl:call-template name="navigational.links">
           <xsl:with-param name="prev" select="$prev"/>

Modified: branches/new-xsl/xhtml/lfs-titles.xsl
===================================================================
--- branches/new-xsl/xhtml/lfs-titles.xsl	2007-06-12 20:51:30 UTC (rev 8164)
+++ branches/new-xsl/xhtml/lfs-titles.xsl	2007-06-14 20:07:24 UTC (rev 8165)
@@ -11,14 +11,12 @@
            No label in preface. -->
     <!-- The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl -->
   <xsl:template name="preface.titlepage">
-    <div class="titlepage">
+    <h1 class="{name(.)}">
       <xsl:if test="@id">
         <a id="{@id}" name="{@id}"/>
       </xsl:if>
-      <h1 class="{name(.)}">
-        <xsl:value-of select="title"/>
-      </h1>
-    </div>
+      <xsl:value-of select="title"/>
+    </h1>
   </xsl:template>
 
     <!-- part.titlepage:
@@ -27,18 +25,16 @@
            but not in titlepage. -->
     <!-- The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl -->
   <xsl:template name="part.titlepage">
-    <div class="titlepage">
+    <h1 class="{name(.)}">
       <xsl:if test="@id">
         <a id="{@id}" name="{@id}"/>
       </xsl:if>
-      <h1 class="{name(.)}">
-        <xsl:if test="$section.autolabel != 0">
-          <xsl:apply-templates select="." mode="label.markup"/>
-          <xsl:text>. </xsl:text>
-        </xsl:if>
-        <xsl:value-of select="title"/>
-      </h1>
-    </div>
+      <xsl:if test="$section.autolabel != 0">
+        <xsl:apply-templates select="." mode="label.markup"/>
+        <xsl:text>. </xsl:text>
+      </xsl:if>
+      <xsl:value-of select="title"/>
+    </h1>
   </xsl:template>
 
     <!-- partintro.titlepage:
@@ -46,14 +42,12 @@
     <!-- The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl -->
   <xsl:template name="partintro.titlepage">
     <xsl:if test="title">
-      <div class="partintrotitle">
+      <h2 class="{name(.)}">
         <xsl:if test="@id">
           <a id="{@id}" name="{@id}"/>
         </xsl:if>
-        <h2 class="{name(.)}">
-          <xsl:value-of select="title"/>
-        </h2>
-      </div>
+        <xsl:value-of select="title"/>
+      </h2>
     </xsl:if>
   </xsl:template>
 
@@ -63,18 +57,16 @@
            but not in titlepage. -->
     <!-- The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl -->
   <xsl:template name="appendix.titlepage">
-    <div class="titlepage">
+    <h1 class="{name(.)}">
       <xsl:if test="@id">
         <a id="{@id}" name="{@id}"/>
       </xsl:if>
-      <h1 class="{name(.)}">
-        <xsl:if test="$section.autolabel != 0">
-          <xsl:apply-templates select="." mode="label.markup"/>
-          <xsl:text>. </xsl:text>
-        </xsl:if>
-        <xsl:value-of select="title"/>
-      </h1>
-    </div>
+      <xsl:if test="$section.autolabel != 0">
+        <xsl:apply-templates select="." mode="label.markup"/>
+        <xsl:text>. </xsl:text>
+      </xsl:if>
+      <xsl:value-of select="title"/>
+    </h1>
   </xsl:template>
 
     <!-- chapter.titlepage:
@@ -83,36 +75,32 @@
            but not in titlepage. -->
     <!-- The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl -->
   <xsl:template name="chapter.titlepage">
-    <div class="titlepage">
+    <h1 class="{name(.)}">
       <xsl:if test="@id">
         <a id="{@id}" name="{@id}"/>
       </xsl:if>
-      <h1 class="{name(.)}">
-        <xsl:if test="$section.autolabel != 0">
-          <xsl:apply-templates select="." mode="label.markup"/>
-          <xsl:text>. </xsl:text>
-        </xsl:if>
-        <xsl:value-of select="title"/>
-      </h1>
-    </div>
+      <xsl:if test="$section.autolabel != 0">
+        <xsl:apply-templates select="." mode="label.markup"/>
+        <xsl:text>. </xsl:text>
+      </xsl:if>
+      <xsl:value-of select="title"/>
+    </h1>
   </xsl:template>
 
     <!-- sect1.titlepage:
            Uses h1 and removed a lot of unneeded code. -->
     <!-- The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl -->
   <xsl:template name="sect1.titlepage">
-    <div class="titlepage">
+    <h1 class="{name(.)}">
       <xsl:if test="@id">
         <a id="{@id}" name="{@id}"/>
       </xsl:if>
-      <h1 class="{name(.)}">
-        <xsl:if test="$section.autolabel != 0">
-          <xsl:apply-templates select="." mode="label.markup"/>
-          <xsl:text>. </xsl:text>
-        </xsl:if>
-        <xsl:value-of select="title"/>
-      </h1>
-    </div>
+      <xsl:if test="$section.autolabel != 0">
+        <xsl:apply-templates select="." mode="label.markup"/>
+        <xsl:text>. </xsl:text>
+      </xsl:if>
+      <xsl:value-of select="title"/>
+    </h1>
   </xsl:template>
 
     <!-- sect2.titlepage:
@@ -124,18 +112,16 @@
     <xsl:choose>
       <xsl:when test="string-length(title) = 0"/>
       <xsl:otherwise>
-        <div class="titlepage">
+        <h2 class="{name(.)}">
           <xsl:if test="@id">
             <a id="{@id}" name="{@id}"/>
           </xsl:if>
-          <h2 class="{name(.)}">
-            <xsl:if test="not(ancestor::preface) and $section.autolabel != 0">
-              <xsl:apply-templates select="." mode="label.markup"/>
-              <xsl:text>. </xsl:text>
-            </xsl:if>
-            <xsl:value-of select="title"/>
-          </h2>
-        </div>
+          <xsl:if test="not(ancestor::preface) and $section.autolabel != 0">
+            <xsl:apply-templates select="." mode="label.markup"/>
+            <xsl:text>. </xsl:text>
+          </xsl:if>
+          <xsl:value-of select="title"/>
+        </h2>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>
@@ -144,29 +130,25 @@
            Uses h3 and removed a lot of unneeded code. -->
     <!-- The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl -->
   <xsl:template name="sect3.titlepage">
-    <div class="titlepage">
+    <h3 class="{name(.)}">
       <xsl:if test="@id">
         <a id="{@id}" name="{@id}"/>
       </xsl:if>
-      <h3 class="{name(.)}">
-        <xsl:if test="$section.autolabel != 0">
-          <xsl:apply-templates select="." mode="label.markup"/>
-          <xsl:text>. </xsl:text>
-        </xsl:if>
-        <xsl:value-of select="title"/>
-      </h3>
-    </div>
+      <xsl:if test="$section.autolabel != 0">
+        <xsl:apply-templates select="." mode="label.markup"/>
+        <xsl:text>. </xsl:text>
+      </xsl:if>
+      <xsl:value-of select="title"/>
+    </h3>
   </xsl:template>
 
     <!-- dedication.titlepage:
            Uses h2 and removed a lot of unneeded code. -->
     <!-- The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl -->
   <xsl:template name="dedication.titlepage">
-    <div class="titlepage">
-      <h2 class="{name(.)}">
-        <xsl:value-of select="title"/>
-      </h2>
-    </div>
+    <h2>
+      <xsl:value-of select="title"/>
+    </h2>
   </xsl:template>
 
     <!-- bridgehead:




More information about the lfs-book mailing list