Solved wrong and dead cross-references.
This commit is contained in:
parent
4761b5a612
commit
4fe29a2cf5
3 changed files with 101 additions and 10 deletions
|
@ -10,4 +10,92 @@
|
||||||
final version and set it to the proper dir via a sed in ./blfs -->
|
final version and set it to the proper dir via a sed in ./blfs -->
|
||||||
<xsl:import href="../blfs-xml/stylesheets/blfs-chunked.xsl"/>
|
<xsl:import href="../blfs-xml/stylesheets/blfs-chunked.xsl"/>
|
||||||
|
|
||||||
|
<xsl:param name="mail_server" select="sendmail"/>
|
||||||
|
|
||||||
|
<xsl:param name="xwindow" select="xorg7"/>
|
||||||
|
|
||||||
|
<!-- Template from BLFS_XML/stylesheets/xhtml/lfs-xref.xsl.-->
|
||||||
|
<xsl:template match="xref" name="xref">
|
||||||
|
|
||||||
|
<!-- IDs that need be remaped to the proper file -->
|
||||||
|
<xsl:variable name="linkend">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="@linkend = 'alsa'">
|
||||||
|
<xsl:text>alsa-lib</xsl:text>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="@linkend = 'arts'">
|
||||||
|
<xsl:text>aRts</xsl:text>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="@linkend = 'kde'">
|
||||||
|
<xsl:text>kdelibs</xsl:text>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="@linkend = 'server-mail'">
|
||||||
|
<xsl:value-of select="$mail_server"/>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="@linkend = 'x-window-system'">
|
||||||
|
<xsl:value-of select="$xwindow"/>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:value-of select="@linkend"/>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:variable>
|
||||||
|
|
||||||
|
<xsl:variable name="targets" select="key('id',$linkend)"/>
|
||||||
|
<!-- -->
|
||||||
|
|
||||||
|
<xsl:variable name="target" select="$targets[1]"/>
|
||||||
|
<xsl:variable name="refelem" select="local-name($target)"/>
|
||||||
|
<xsl:variable name="role" select="@role"/>
|
||||||
|
<xsl:call-template name="check.id.unique">
|
||||||
|
<xsl:with-param name="linkend" select="$linkend"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="anchor"/>
|
||||||
|
<xsl:choose>
|
||||||
|
|
||||||
|
<!-- Dead links -->
|
||||||
|
<xsl:when test="count($target) = 0">
|
||||||
|
<xsl:value-of select="@linkend"/>
|
||||||
|
<xsl:text> (link in the full book)</xsl:text>
|
||||||
|
</xsl:when>
|
||||||
|
<!-- -->
|
||||||
|
|
||||||
|
<xsl:when test="$target/@xreflabel">
|
||||||
|
<a>
|
||||||
|
<xsl:attribute name="href">
|
||||||
|
<xsl:call-template name="href.target">
|
||||||
|
<xsl:with-param name="object" select="$target"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:attribute>
|
||||||
|
<xsl:call-template name="xref.xreflabel">
|
||||||
|
<xsl:with-param name="target" select="$target"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</a>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:variable name="href">
|
||||||
|
<xsl:call-template name="href.target">
|
||||||
|
<xsl:with-param name="object" select="$target"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:variable>
|
||||||
|
<xsl:apply-templates select="$target" mode="xref-to-prefix"/>
|
||||||
|
<a href="{$href}">
|
||||||
|
<xsl:if test="$target/title or $target/*/title">
|
||||||
|
<xsl:attribute name="title">
|
||||||
|
<xsl:apply-templates select="$target" mode="xref-title"/>
|
||||||
|
</xsl:attribute>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:apply-templates select="$target" mode="xref-to">
|
||||||
|
<xsl:with-param name="referrer" select="."/>
|
||||||
|
<xsl:with-param name="role" select="$role"/>
|
||||||
|
<xsl:with-param name="xrefstyle">
|
||||||
|
<xsl:value-of select="@xrefstyle"/>
|
||||||
|
</xsl:with-param>
|
||||||
|
</xsl:apply-templates>
|
||||||
|
</a>
|
||||||
|
<xsl:apply-templates select="$target" mode="xref-to-suffix"/>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
|
|
@ -195,26 +195,26 @@ inline_doc
|
||||||
# Special packages (a lot of hacks)
|
# Special packages (a lot of hacks)
|
||||||
case $DEP in
|
case $DEP in
|
||||||
|
|
||||||
db ) # The proper version of DB is installed in LFS
|
db ) continue ;; # The proper version of DB is installed in LFS
|
||||||
continue ;;
|
|
||||||
|
|
||||||
# Don't have their own XML file
|
# Don't have their own XML file
|
||||||
hal-requirements | hal-runtime-dependencies )
|
hal-requirements | hal-runtime-dependencies ) continue ;;
|
||||||
continue ;;
|
perl-* | tk-perl ) DEP=perl-modules ;;
|
||||||
|
|
||||||
# Orphan links (proper link must be created when generating the book)
|
# Orphan links (proper link must be created when generating the book)
|
||||||
arts ) DEP=aRts ;;
|
arts ) DEP=aRts ;;
|
||||||
kde ) DEP=kde-core ;;
|
kde ) DEP=kde-core ;;
|
||||||
perl-* | tk-perl ) DEP=perl-modules ;;
|
|
||||||
|
# Dummy gnome-core pages
|
||||||
GNOME-desktop-file-utils ) DEP=desktop-file-utils ;;
|
GNOME-desktop-file-utils ) DEP=desktop-file-utils ;;
|
||||||
GNOME-shared-mime-info ) DEP=shared-mime-info ;;
|
GNOME-shared-mime-info ) DEP=shared-mime-info ;;
|
||||||
|
|
||||||
# Set values for alternative packages
|
# Set values for alternative packages
|
||||||
# X is a meta-package, thus handled in another way.
|
# X is a meta-package, thus handled in another way.
|
||||||
LPRng | cups ) DEP=$PRINT_SERVER ;;
|
LPRng | cups ) DEP=$PRINT_SERVER ;;
|
||||||
mitkrb | heimdal ) DEP=$KBR5 ;;
|
mitkrb | heimdal ) DEP=$KBR5 ;;
|
||||||
gs | espgs ) DEP=$GHOSTSCRIPT ;;
|
gs | espgs ) DEP=$GHOSTSCRIPT ;;
|
||||||
server-mail ) DEP=$MAIL_SERVER ;;
|
server-mail ) DEP=$MAIL_SERVER ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
#------------------
|
#------------------
|
||||||
|
|
|
@ -98,7 +98,10 @@ inline_doc
|
||||||
local filename # output filename
|
local filename # output filename
|
||||||
|
|
||||||
echo -en "\tGenerating the HTML book ..."
|
echo -en "\tGenerating the HTML book ..."
|
||||||
xsltproc --xinclude --nonet --stringparam base.dir HTML/ \
|
xsltproc --xinclude --nonet \
|
||||||
|
--stringparam mail_server $MAIL_SERVER \
|
||||||
|
--stringparam xwindow $X11 \
|
||||||
|
--stringparam base.dir HTML/ \
|
||||||
../libs/book.xsl \
|
../libs/book.xsl \
|
||||||
$TARGET-index.xml > xsltproc.log 2>&1
|
$TARGET-index.xml > xsltproc.log 2>&1
|
||||||
|
|
||||||
|
|
Reference in a new issue