Ver Fonte

Integrated HLFS code.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/new-xsl@8138 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Manuel Canales Esparcia há 18 anos atrás
pai
commit
5c360811cf
8 ficheiros alterados com 190 adições e 38 exclusões
  1. 22 0
      hlfs-chunked.xsl
  2. 24 0
      hlfs-nochunks.xsl
  3. 18 0
      hlfs-pdf.xsl
  4. 43 9
      lfs-nochunks.xsl
  5. 2 1
      lfs-profile.xsl
  6. 43 9
      lfs.css
  7. 27 19
      xhtml/lfs-mixed.xsl
  8. 11 0
      xhtml/lfs-navigational.xsl

+ 22 - 0
hlfs-chunked.xsl

@@ -0,0 +1,22 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+
+<!--
+$LastChangedBy$
+$Date$
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns="http://www.w3.org/1999/xhtml"
+                version="1.0">
+
+    <!-- LFS top-level chunk templates. -->
+  <xsl:import href="lfs-chunked.xsl"/>
+
+    <!-- The LFS book type to be processed (lfs, blfs, clfs, or hlfs) -->
+  <xsl:param name="book-type">hlfs</xsl:param>
+
+    <!-- List of strings used inside @role attributes for additional features.
+         The list must start and end with a "," -->
+  <xsl:param name="hlfs-features">,ssp,aslr,pax,hardened_tmp,warnings,misc,blowfish,</xsl:param>
+
+</xsl:stylesheet>

+ 24 - 0
hlfs-nochunks.xsl

@@ -0,0 +1,24 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+
+<!--
+$LastChangedBy$
+$Date$
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns="http://www.w3.org/1999/xhtml"
+                version="1.0">
+
+    <!-- LFS top-level no-chunk templates. -->
+  <xsl:import href="lfs-nochunks.xsl"/>
+
+    <!-- The LFS book type to be processed (lfs, blfs, clfs, or hlfs) -->
+  <xsl:param name="book-type">hlfs</xsl:param>
+
+    <!-- List of strings used inside @role attributes for additional features.
+         The list must start and end with a ","
+         The features JavaScript code is not used on nochunk output, but the
+         XSL and CSS code need this param. -->
+  <xsl:param name="hlfs-features">,ssp,aslr,pax,hardened_tmp,warnings,misc,blowfish,</xsl:param>
+
+</xsl:stylesheet>

+ 18 - 0
hlfs-pdf.xsl

@@ -0,0 +1,18 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+
+<!--
+$LastChangedBy$
+$Date$
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                version="1.0">
+
+    <!-- LFS top-level pdf templates. -->
+  <xsl:import href="lfs-pdf.xsl"/>
+
+    <!-- The LFS book type to be processed (lfs, blfs, clfs, or hlfs) -->
+  <xsl:param name="book-type">hlfs</xsl:param>
+
+</xsl:stylesheet>

+ 43 - 9
lfs-nochunks.xsl

@@ -550,8 +550,7 @@ tt, code, kbd, pre, .command {
   font-style: italic;
 }
 
-pre.userinput {
-  color: #101310;
+pre {
   background-color: #e5e5e5;
   border: 1px solid #050505;
   padding: .5em 1em;
@@ -559,21 +558,19 @@ pre.userinput {
   font-weight: bold;
 }
 
+pre.userinput {
+  color: #101310;
+}
+
 pre.root {
   color: #101310;
-  background-color: #e5e5e5;
   border: 1px solid #11a;
-  padding: .5em 1em;
-  margin: 0 2em;
-  font-weight: bold;
 }
 
 pre.screen {
   color: #000;
   background-color: #e9e9e9;
-  border: 1px solid #050505;
-  padding: .5em 1em;
-  margin: 0 2em;
+  font-weight: normal;
 }
 
 .literal, .prompt {
@@ -600,6 +597,43 @@ p.updated {
   font-weight: bold;
   font-style: italic;
 }
+
+
+/* Special colored blocks */
+  /* OrangeRed4 */
+.feature-ssp {
+  color: #8B2500;
+}
+
+  /* RoyalBlue3 */
+.feature-aslr {
+  color: #3A5FCD;
+}
+
+  /* NavyBlue */
+.feature-pax {
+  color: #000080;
+}
+
+  /* VioletRed */
+.feature-hardened_tmp {
+  color: #d02090;
+}
+
+  /* PaleTurquoise4 */
+.feature-warnings {
+  color: #668b8b;
+}
+
+  /* RosyBrown */
+.feature-misc {
+  color: #bc8f8f;
+}
+
+  /* Sienna*/
+.feature-blowfish {
+  color: #8E6B23
+}
       </xsl:text>
     </style>
   </xsl:template>

+ 2 - 1
lfs-profile.xsl

@@ -22,7 +22,8 @@
               doctype-system="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"/>
 
   <!-- Profiling parameters:
-         profile.separator changed from ; to , to let in work in command line. -->
+         profile.separator changed from ";" to "," to let it work
+         at command line. -->
   <xsl:param name="profile.arch" select="''"/>
   <xsl:param name="profile.audience" select="''"/>
   <xsl:param name="profile.condition" select="''"/>

+ 43 - 9
lfs.css

@@ -510,8 +510,7 @@ tt, code, kbd, pre, .command {
   font-style: italic;
 }
 
-pre.userinput {
-  color: #101310;
+pre {
   background-color: #e5e5e5;
   border: 1px solid #050505;
   padding: .5em 1em;
@@ -519,21 +518,19 @@ pre.userinput {
   font-weight: bold;
 }
 
+pre.userinput {
+  color: #101310;
+}
+
 pre.root {
   color: #101310;
-  background-color: #e5e5e5;
   border: 1px solid #11a;
-  padding: .5em 1em;
-  margin: 0 2em;
-  font-weight: bold;
 }
 
 pre.screen {
   color: #000;
   background-color: #e9e9e9;
-  border: 1px solid #050505;
-  padding: .5em 1em;
-  margin: 0 2em;
+  font-weight: normal;
 }
 
 .literal, .prompt {
@@ -560,3 +557,40 @@ p.updated {
   font-weight: bold;
   font-style: italic;
 }
+
+
+/* Special colored blocks */
+  /* OrangeRed4 */
+.feature-ssp {
+  color: #8B2500;
+}
+
+  /* RoyalBlue3 */
+.feature-aslr {
+  color: #3A5FCD;
+}
+
+  /* NavyBlue */
+.feature-pax {
+  color: #000080;
+}
+
+  /* VioletRed */
+.feature-hardened_tmp {
+  color: #d02090;
+}
+
+  /* PaleTurquoise4 */
+.feature-warnings {
+  color: #668b8b;
+}
+
+  /* RosyBrown */
+.feature-misc {
+  color: #bc8f8f;
+}
+
+  /* Sienna*/
+.feature-blowfish {
+  color: #8E6B23
+}

+ 27 - 19
xhtml/lfs-mixed.xsl

@@ -11,7 +11,8 @@
   <!-- Individual elements templates -->
 
     <!-- para:
-           Added a choose to skip empty "Home page" in packages.xml -->
+           Added a choose to skip empty "Home page" in packages.xml.
+           Added an if for HLFS features. -->
     <!-- The original template is in {docbook-xsl}/xhtml/block.xsl -->
   <xsl:template match="para">
     <xsl:choose>
@@ -19,7 +20,12 @@
       <xsl:otherwise>
         <xsl:call-template name="paragraph">
           <xsl:with-param name="class">
-            <xsl:if test="@role and $para.propagates.style != 0">
+            <xsl:if test="@role">
+              <xsl:if test="$book-type = 'hlfs'">
+                <xsl:if test="contains($hlfs-features,concat(',',@role,','))">
+                  <xsl:text>feature-</xsl:text>
+                </xsl:if>
+              </xsl:if>
               <xsl:value-of select="@role"/>
             </xsl:if>
           </xsl:with-param>
@@ -44,23 +50,25 @@
          It match also programlisting and synopsis. The code for that tags
          is unchanged. -->
   <xsl:template match="screen">
-    <xsl:choose>
-      <xsl:when test="@role = 'root'">
-        <pre class="root">
-          <xsl:apply-templates/>
-        </pre>
-      </xsl:when>
-      <xsl:when test="child::* = userinput">
-        <pre class="userinput">
-          <xsl:apply-templates/>
-        </pre>
-      </xsl:when>
-      <xsl:otherwise>
-        <pre class="{name(.)}">
-          <xsl:apply-templates/>
-        </pre>
-      </xsl:otherwise>
-    </xsl:choose>
+    <pre>
+      <xsl:attribute name="class">
+        <xsl:choose>
+          <xsl:when test="@role and not(@role = 'nodump')">
+            <xsl:if test="$book-type = 'hlfs'">
+              <xsl:if test="contains($hlfs-features,concat(',',@role,','))">
+                <xsl:text>feature-</xsl:text>
+              </xsl:if>
+            </xsl:if>
+            <xsl:value-of select="@role"/>
+          </xsl:when>
+          <xsl:when test="child::* = userinput">userinput</xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="name(.)"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:attribute>
+      <xsl:apply-templates/>
+    </pre>
   </xsl:template>
 
     <!-- userinput:

+ 11 - 0
xhtml/lfs-navigational.xsl

@@ -78,6 +78,17 @@
         </xsl:call-template>
       </div>
     </xsl:if>
+    <xsl:if test="$book-type = 'hlfs'">
+      <script type="text/javascript">
+        <xsl:attribute name="src">
+          <xsl:choose>
+            <xsl:when test="local-name(.)='book' or local-name(.)='part' or
+                            local-name(.)='index'">../features.js</xsl:when>
+            <xsl:otherwise>../../features.js</xsl:otherwise>
+          </xsl:choose>
+        </xsl:attribute>
+      </script>
+    </xsl:if>
   </xsl:template>
 
     <!-- navigational.links: