Author: manuel Date: 2007-03-29 14:37:25 -0600 (Thu, 29 Mar 2007) New Revision: 7989
Modified: branches/new-xsl/xhtml/lfs-index.xsl Log: More work on xhtml/lfs-index.xsl. Modified: branches/new-xsl/xhtml/lfs-index.xsl =================================================================== --- branches/new-xsl/xhtml/lfs-index.xsl 2007-03-29 18:43:10 UTC (rev 7988) +++ branches/new-xsl/xhtml/lfs-index.xsl 2007-03-29 20:37:25 UTC (rev 7989) @@ -1,9 +1,9 @@ <?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())'> +<!ENTITY lowercase "'AaÀàÁáÂâÃãÄäÅåĀāĂ㥹ǍǎǞǟǠǡǺǻȀȁȂȃȦȧḀḁẚẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặBbƀƁɓƂƃḂḃḄḅḆḇCcÇçĆćĈĉĊċČčƇƈɕḈḉDdĎďĐđƊɗƋƌDžDzȡɖḊḋḌḍḎḏḐḑḒḓEeÈèÉéÊêËëĒēĔĕĖėĘęĚěȄȅȆȇȨȩḔḕḖḗḘḙḚḛḜḝẸẹẺẻẼẽẾế& #7872;ềỂểỄễỆệFfƑƒḞḟGgĜĝĞğĠġĢģƓɠǤǥǦǧǴǵḠḡHhĤĥĦħȞȟɦḢḣḤḥḦḧḨḩḪḫẖIiÌìÍíÎîÏïĨĩĪīĬĭĮįİƗɨǏǐȈȉȊȋḬḭḮḯỈỉỊịJjĴĵǰʝKkĶķƘƙǨǩḰḱḲḳḴḵLlĹĺĻļĽľĿŀŁłƚLjȴɫɬɭḶḷḸḹḺḻḼḽMmɱḾḿṀṁṂṃNnÑñŃńŅņŇňƝɲƞȠNjǸǹȵɳṄṅṆṇṈṉṊ&# 7755;OoÒòÓóÔôÕõÖöØøŌōŎŏŐőƟƠơǑǒǪǫǬǭǾǿȌȍȎȏȪȫȬȭȮȯȰȱṌṍṎṏṐṑṒṓỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợPpƤƥṔṕṖṗQqʠRrŔŕŖŗŘřȐȑȒȓɼɽɾṘṙṚṛṜṝṞṟSsŚśŜŝŞşŠšȘșʂṠṡṢṣṤṥṦṧṨṩTtŢţŤťŦŧƫƬƭƮʈȚțȶṪṫṬṭṮṯṰṱẗUuÙùÚúÛû& #220;üŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜȔȕȖȗṲṳṴṵṶṷṸṹṺṻỤụỦủỨứỪừỬửỮữỰựVvƲʋṼṽṾṿWwŴŵẀẁẂẃẄẅẆẇẈẉẘXxẊẋẌẍYyÝýÿŸŶŷƳƴȲȳẎẏẙỲỳỴỵỶỷỸỹZzŹźŻżŽžƵƶȤȥʐʑẐẑẒẓẔẕẕ'"> +<!ENTITY uppercase "'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFFFFFGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJJJJJJKKKKKKKKKKKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPPPPPQQQRRRRRRRRRRRRRRRRRRRRRRRSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVVVVVVVWWWWWWWWWWWWWWWXXXXXXYYYYYYYYYYYYYYYYYYYYYYYZZZZZZZZZZZZZZZZZZZZZ'"> +<!ENTITY primary 'normalize-space(concat(primary/@sortas, primary[not(@sortas) or @sortas = ""]))'> +<!ENTITY scope "count(ancestor::node()|$scope) = count(ancestor::node()) and ($role = @role or $type = @type or (string-length($role) = 0 and string-length($type) = 0))"> ]> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" @@ -18,20 +18,31 @@ <!-- The indexing method used. Only 'basic' is supported by xsltproc --> <xsl:param name="index.method" select="'basic'"></xsl:param> - <!--The file name of the Index page --> + <!-- The file name of the Index page. + There is no upstream template with match="index", only a global + match="*", thus the next template is enought to force the Index + filename. --> <xsl:template match="index" mode="recursive-chunk-filename"> <xsl:text>longindex.html</xsl:text> </xsl:template> - <!--Title--> + <!--The Index title. We create this param to can have gettext support in + both the Index page title and links that point to the Index page. + It also allow us to change the title, if wanted.--> <xsl:param name="index-title">Index</xsl:param> + <!-- The Index title in links that points to it. --> + <!-- The original template is in {docbook-xsl}/common/titles.xsl --> <xsl:template match="index" mode="title.markup"> <xsl:call-template name="gentext"> <xsl:with-param name="key" select="$index-title"/> </xsl:call-template> </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 --> <xsl:template name="index.titlepage"> <div class="titlepage"> <h1 class="index"> @@ -43,8 +54,10 @@ </xsl:template> <!--Divisions--> - <xsl:template match="indexterm" mode="index-div"> + <xsl:template match="indexterm" mode="index-div-basic"> <xsl:param name="scope" select="."/> + <xsl:param name="role" select="''"/> + <xsl:param name="type" 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 --> @@ -107,6 +120,8 @@ <!-- Changing the output tags and re-addind the separator--> <xsl:template match="indexterm" mode="index-primary"> <xsl:param name="scope" select="."/> + <xsl:param name="role" select="''"/> + <xsl:param name="type" select="''"/> <xsl:variable name="key" select="&primary;"/> <xsl:variable name="refs" select="key('primary', $key)[&scope;]"/> <li> @@ -139,6 +154,8 @@ <xsl:template match="indexterm" mode="index-secondary"> <xsl:param name="scope" select="."/> + <xsl:param name="role" select="''"/> + <xsl:param name="type" select="''"/> <xsl:variable name="key" select="concat(&primary;, " ", normalize-space(concat(secondary/@sortas, secondary[not(@sortas)])))"/> <xsl:variable name="refs" select="key('secondary', $key)[&scope;]"/> @@ -162,6 +179,8 @@ <!--Links (This template also fix a bug in the original code)--> <xsl:template name="reference"> <xsl:param name="scope" select="."/> + <xsl:param name="role" select="''"/> + <xsl:param name="type" select="''"/> <xsl:param name="zones"/> <xsl:choose> <xsl:when test="contains($zones, ' ')"> -- http://linuxfromscratch.org/mailman/listinfo/lfs-book FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
