Index: stylesheets/blfs-chunked.xsl
===================================================================
--- stylesheets/blfs-chunked.xsl	(revision dd3f20f0b684628b62144bc4778527bb4c3df922)
+++ stylesheets/blfs-chunked.xsl	(revision ae8a3e477c6097c7f308a1db0801a9a253e8e298)
@@ -5,9 +5,13 @@
 
   <!-- We use XHTML -->
-  <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk.xsl"/>
+  <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.65.1/xhtml/chunk.xsl"/>
   <xsl:param name="chunker.output.encoding" select="'ISO-8859-1'"/>
 
   <!-- The CSS Stylesheet -->
   <xsl:param name="html.stylesheet" select="'../stylesheets/blfs.css'"/>
+
+  <!-- Include our customised templates -->
+  <xsl:include href="xhtml/blfs-toc.xsl"/>
+  <xsl:include href="xhtml/blfs-index.xsl"/>
 
   <!-- Use graphics in admonitions -->
Index: stylesheets/blfs.css
===================================================================
--- stylesheets/blfs.css	(revision dd3f20f0b684628b62144bc4778527bb4c3df922)
+++ stylesheets/blfs.css	(revision ae8a3e477c6097c7f308a1db0801a9a253e8e298)
@@ -108,2 +108,17 @@
     font-family: courier, monospace;
 }
+
+.item {
+    width: 15em;
+    float: left;
+}
+
+.secitem {
+    font-weight: normal;
+    width: 12.5em;
+    float: left;
+}
+
+.toc ul, .index ul, .navheader ul, .navfooter ul {
+	list-style: none;
+}
Index: stylesheets/xhtml/blfs-index.xsl
===================================================================
--- stylesheets/xhtml/blfs-index.xsl	(revision ae8a3e477c6097c7f308a1db0801a9a253e8e298)
+++ stylesheets/xhtml/blfs-index.xsl	(revision ae8a3e477c6097c7f308a1db0801a9a253e8e298)
@@ -0,0 +1,177 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+<!DOCTYPE xsl:stylesheet [
+<!ENTITY lowercase "'abcdefghijklmnopqrstuvwxyz'">
+<!ENTITY uppercase "'ABCDEFGHIJKLMNOPQRSTUVWXYZ'">
+<!ENTITY primary   'normalize-space(concat(primary/@sortas, primary[not(@sortas)]))'>
+<!ENTITY scope 'count(ancestor::node()|$scope) = count(ancestor::node())'>
+]>
+
+<!-- Version 0.8.0 - Manuel Canales Esparcia <macana@lfs-es.org> -->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns="http://www.w3.org/1999/xhtml"
+                version="1.0">
+
+	<!--Index Stuff-->
+
+    <!--Filename-->
+  <xsl:template match="index" mode="recursive-chunk-filename">
+    <xsl:text>longindex.html</xsl:text>
+  </xsl:template>
+
+    <!--Title-->
+  <xsl:template match="index" mode="title.markup">
+  	<xsl:param name="allow-anchors" select="0"/>
+    <xsl:text>Index of packages and important installed files</xsl:text>
+	</xsl:template>
+
+  	<!--Divisions-->
+  <xsl:template match="indexterm" mode="index-div">
+    <xsl:param name="scope" select="."/>
+    <xsl:variable name="key" select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
+    <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'">
+              	<xsl:text>Packages</xsl:text>
+             </xsl:when>
+             <xsl:when test="$divtitle = 'B'">
+              	<xsl:text>Programs</xsl:text>
+             </xsl:when>
+             <xsl:when test="$divtitle = 'C'">
+              	<xsl:text>Libraries</xsl:text>
+             </xsl:when>
+             <xsl:when test="$divtitle = 'D'">
+              	<xsl:text>Scripts</xsl:text>
+             </xsl:when>
+              <xsl:when test="$divtitle = 'E'">
+                  <xsl:text>Others</xsl:text>
+              </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:if>
+  </xsl:template>
+
+  	<!-- Dropping the separator from here-->
+  <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>
+
+  	<!-- Changing the output tags and re-addind the separator-->
+  <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;]"/>
+    <li>
+    	<strong class="item">
+      	<xsl:value-of select="primary"/>
+        <xsl:text>: </xsl:text>
+			</strong>
+      <xsl:for-each select="$refs[generate-id() = generate-id(key('primary-section',
+      				concat($key, &#34; &#34;, generate-id((ancestor-or-self::book |ancestor-or-self::part
+              |ancestor-or-self::chapter |ancestor-or-self::appendix |ancestor-or-self::preface
+              |ancestor-or-self::sect1 |ancestor-or-self::sect2 |ancestor-or-self::sect3
+              |ancestor-or-self::sect4 |ancestor-or-self::sect5 |ancestor-or-self::index)[last()])))[&scope;][1])]">
+        <xsl:apply-templates select="." mode="reference">
+          <xsl:with-param name="scope" select="$scope"/>
+        </xsl:apply-templates>
+      </xsl:for-each>
+    	<xsl:if test="$refs/secondary">
+        <ul>
+          <xsl:apply-templates select="$refs[secondary and count(.|key('secondary', 
+          				concat($key, &#34; &#34;, normalize-space(concat(secondary/@sortas,
+                  secondary[not(@sortas)]))))[&scope;][1]) = 1]" mode="index-secondary">
+            <xsl:with-param name="scope" select="$scope"/>
+            <xsl:sort select="translate(normalize-space(concat(secondary/@sortas, 
+            				secondary[not(@sortas)])), &lowercase;, &uppercase;)"/>
+          </xsl:apply-templates>
+     		</ul>
+    	</xsl:if>
+    </li>
+  </xsl:template>
+  <xsl:template match="indexterm" mode="index-secondary">
+    <xsl:param name="scope" select="."/>
+    <xsl:variable name="key" select="concat(&primary;, &#34; &#34;,
+    				normalize-space(concat(secondary/@sortas, secondary[not(@sortas)])))"/>
+    <xsl:variable name="refs" select="key('secondary', $key)[&scope;]"/>
+    <li>
+    	<strong class="secitem">
+      	<xsl:value-of select="secondary"/>
+        <xsl:text>: </xsl:text>
+			</strong>
+      <xsl:for-each select="$refs[generate-id() = generate-id(key('secondary-section',
+      				concat($key, &#34; &#34;, generate-id((ancestor-or-self::book |ancestor-or-self::part
+              |ancestor-or-self::chapter |ancestor-or-self::appendix |ancestor-or-self::preface
+              |ancestor-or-self::sect1 |ancestor-or-self::sect2 |ancestor-or-self::sect3
+              |ancestor-or-self::sect4 |ancestor-or-self::sect5 |ancestor-or-self::index)[last()])))[&scope;][1])]">
+        <xsl:apply-templates select="." mode="reference">
+          <xsl:with-param name="scope" select="$scope"/>
+        </xsl:apply-templates>
+      </xsl:for-each>
+    </li>
+  </xsl:template>
+
+    <!--Links (This template also fix a bug in the original code)-->
+  <xsl:template name="reference">
+    <xsl:param name="scope" select="."/>
+    <xsl:param name="zones"/>
+    <xsl:choose>
+      <xsl:when test="contains($zones, ' ')">
+        <xsl:variable name="zone" select="substring-before($zones, ' ')"/>
+        <xsl:variable name="zone2" select="substring-after($zones, ' ')"/>
+        <xsl:variable name="target" select="key('sections', $zone)[&scope;]"/>
+        <xsl:variable name="target2" select="key('sections', $zone2)[&scope;]"/>
+        <a>
+          <xsl:attribute name="href">
+            <xsl:call-template name="href.target.uri">
+              <xsl:with-param name="object" select="$target[1]"/>
+            </xsl:call-template>
+          </xsl:attribute>
+          <xsl:apply-templates select="$target[1]" mode="index-title-content"/>
+        </a>
+        <xsl:text> -- </xsl:text>
+        <a>
+          <xsl:attribute name="href">
+            <xsl:call-template name="href.target.uri">
+              <xsl:with-param name="object" select="$target2[1]"/>
+            </xsl:call-template>
+          </xsl:attribute>
+          <xsl:text>description</xsl:text>
+        </a>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:variable name="zone" select="$zones"/>
+        <xsl:variable name="target" select="key('sections', $zone)[&scope;]"/>
+        <a>
+          <xsl:attribute name="href">
+            <xsl:call-template name="href.target.uri">
+              <xsl:with-param name="object" select="$target[1]"/>
+            </xsl:call-template>
+          </xsl:attribute>
+          <xsl:apply-templates select="$target[1]" mode="index-title-content"/>
+        </a>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+</xsl:stylesheet>
Index: stylesheets/xhtml/blfs-toc.xsl
===================================================================
--- stylesheets/xhtml/blfs-toc.xsl	(revision ae8a3e477c6097c7f308a1db0801a9a253e8e298)
+++ stylesheets/xhtml/blfs-toc.xsl	(revision ae8a3e477c6097c7f308a1db0801a9a253e8e298)
@@ -0,0 +1,110 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+
+<!-- Version 0.8.0 - Manuel Canales Esparcia <macana@lfs-es.org> -->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns="http://www.w3.org/1999/xhtml"
+                version="1.0">
+
+
+<!--TOC stuff-->
+  <xsl:param name="generate.toc">
+    appendix  toc
+    book      toc,title,figure,table,example,equation
+    chapter   nop
+    part      toc
+    preface   nop
+    qandadiv  nop
+    qandaset  nop
+    reference nop
+    sect1     nop
+    sect2     nop
+    sect3     nop
+    sect4     nop
+    sect5     nop
+    section   nop
+    set       nop
+  </xsl:param>
+
+  <xsl:param name="toc.section.depth">1</xsl:param>
+
+  <xsl:param name="toc.max.depth">3</xsl:param>
+
+    <!-- Type of list-->
+  <xsl:param name="toc.list.type">ul</xsl:param>
+
+    <!--Adding the h* tags and dropping redundats links-->
+  <xsl:template name="toc.line">
+    <xsl:param name="toc-context" select="."/>
+    <xsl:param name="depth" select="1"/>
+    <xsl:param name="depth.from.context" select="8"/>
+    <xsl:choose>
+      <xsl:when test="local-name(.) = 'sect1'">
+        <span>
+          <xsl:attribute name="class"><xsl:value-of select="local-name(.)"/></xsl:attribute>
+          <a>
+            <xsl:attribute name="href">
+              <xsl:call-template name="href.target">
+                <xsl:with-param name="context" select="$toc-context"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:apply-templates select="." mode="titleabbrev.markup"/>
+          </a>
+        </span>
+      </xsl:when>
+      <xsl:when test="local-name(.) = 'chapter' or local-name(.) = 'preface'">
+        <h4>
+          <span>
+            <xsl:attribute name="class"><xsl:value-of select="local-name(.)"/></xsl:attribute>
+            <xsl:variable name="label">
+              <xsl:apply-templates select="." mode="label.markup"/>
+            </xsl:variable>
+            <xsl:copy-of select="$label"/>
+            <xsl:if test="$label != ''">
+              <xsl:value-of select="$autotoc.label.separator"/>
+            </xsl:if>
+            <xsl:apply-templates select="." mode="titleabbrev.markup"/>
+          </span>
+        </h4>
+      </xsl:when>
+      <xsl:when test="local-name(.) = 'part'">
+        <h3>
+          <span>
+            <xsl:attribute name="class"><xsl:value-of select="local-name(.)"/></xsl:attribute>
+            <xsl:variable name="label">
+              <xsl:apply-templates select="." mode="label.markup"/>
+            </xsl:variable>
+            <xsl:copy-of select="$label"/>
+            <xsl:if test="$label != ''">
+              <xsl:value-of select="$autotoc.label.separator"/>
+            </xsl:if>
+            <xsl:apply-templates select="." mode="titleabbrev.markup"/>
+          </span>
+        </h3>
+      </xsl:when>
+      <xsl:otherwise>
+        <h3>
+          <span>
+            <xsl:attribute name="class"><xsl:value-of select="local-name(.)"/></xsl:attribute>
+            <a>
+              <xsl:attribute name="href">
+                <xsl:call-template name="href.target">
+                  <xsl:with-param name="context" select="$toc-context"/>
+                </xsl:call-template>
+              </xsl:attribute>
+              <xsl:variable name="label">
+                <xsl:apply-templates select="." mode="label.markup"/>
+              </xsl:variable>
+              <xsl:copy-of select="$label"/>
+              <xsl:if test="$label != ''">
+                <xsl:value-of select="$autotoc.label.separator"/>
+              </xsl:if>
+              <xsl:apply-templates select="." mode="titleabbrev.markup"/>
+            </a>
+          </span>
+        </h3>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+</xsl:stylesheet>
