diff options
author | Shaun McCance <shaunm@src.gnome.org> | 2008-06-27 16:24:06 +0000 |
---|---|---|
committer | Shaun McCance <shaunm@src.gnome.org> | 2008-06-27 16:24:06 +0000 |
commit | 4ffe4546713d5d55e35a19f6989f6e0b2e7231aa (patch) | |
tree | 3a57d298a9804beefc1a554dea1c142baa07aa90 | |
parent | 1eeca19131b42aba7609ae30dcfa0920486e4a92 (diff) | |
download | gnome-doc-utils-4ffe4546713d5d55e35a19f6989f6e0b2e7231aa.tar.gz |
- Correctly handle content and tooltips for links to anchor elements
* xslt/docbook/common/db-title.xsl:
* xslt/docbook/common/db-xref.xsl:
- Correctly handle content and tooltips for links to anchor elements
* xslt/docbook/html/db2html-division.xsl:
- Don't reprocess book titles when title and bookinfo/title exist
svn path=/trunk/; revision=1106
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | xslt/docbook/common/db-title.xsl | 17 | ||||
-rw-r--r-- | xslt/docbook/common/db-xref.xsl | 35 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-division.xsl | 5 |
4 files changed, 59 insertions, 7 deletions
@@ -1,3 +1,12 @@ +2008-07-27 Shaun McCance <shaunm@gnome.org> + + * xslt/docbook/common/db-title.xsl: + * xslt/docbook/common/db-xref.xsl: + - Correctly handle content and tooltips for links to anchor elements + + * xslt/docbook/html/db2html-division.xsl: + - Don't reprocess book titles when title and bookinfo/title exist + 2008-03-21 Marc-Andre Lureau <marcandre.lureau@gmail.com> * Makefile.am, configure.in, m4/glib-gettext.m4: diff --git a/xslt/docbook/common/db-title.xsl b/xslt/docbook/common/db-title.xsl index f5156dc..f8d821c 100644 --- a/xslt/docbook/common/db-title.xsl +++ b/xslt/docbook/common/db-title.xsl @@ -22,7 +22,7 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA <!--!!========================================================================== DocBook Titles -:Requires: gettext +:Requires: db-chunk gettext --> @@ -87,6 +87,21 @@ REMARK: Describe this mode </xsl:template> <!-- = db.title.mode % appendix = --> +<xsl:template mode="db.title.mode" match="anchor"> + <xsl:variable name="target_chunk_id"> + <xsl:call-template name="db.chunk.chunk-id"> + <xsl:with-param name="node" select="."/> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="target_chunk" select="key('idkey', $target_chunk_id)"/> + <xsl:choose> + <xsl:when test="$target_chunk"> + <xsl:apply-templates mode="db.title.mode" select="$target_chunk"/> + </xsl:when> + </xsl:choose> +</xsl:template> + +<!-- = db.title.mode % appendix = --> <xsl:template mode="db.title.mode" match="appendix"> <xsl:choose> <xsl:when test="title"> diff --git a/xslt/docbook/common/db-xref.xsl b/xslt/docbook/common/db-xref.xsl index 96aeb90..7f7386b 100644 --- a/xslt/docbook/common/db-xref.xsl +++ b/xslt/docbook/common/db-xref.xsl @@ -116,12 +116,35 @@ $role: For a role-based ${xrefstyle}, the role of the cross reference REMARK: Document this mode --> <xsl:template mode="db.xref.content.mode" match="*"> - <xsl:message> - <xsl:text>No cross reference formatter found for </xsl:text> - <xsl:value-of select="local-name(.)"/> - <xsl:text> elements</xsl:text> - </xsl:message> - <xsl:call-template name="db.title"/> + <xsl:variable name="target_chunk_id"> + <xsl:call-template name="db.chunk.chunk-id"> + <xsl:with-param name="node" select="."/> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="target_chunk" select="key('idkey', $target_chunk_id)"/> + <xsl:choose> + <xsl:when test="$target_chunk"> + <xsl:apply-templates mode="db.xref.content.mode" select="$target_chunk"/> + </xsl:when> + <xsl:otherwise> + <xsl:message> + <xsl:text>No cross reference formatter found for </xsl:text> + <xsl:value-of select="local-name(.)"/> + <xsl:text> elements</xsl:text> + </xsl:message> + <xsl:variable name="title"> + <xsl:call-template name="db.title"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="string($title) != ''"> + <xsl:copy-of select="$title"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="@id"/> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> </xsl:template> <!-- = db.xref.content.mode % appendix = --> diff --git a/xslt/docbook/html/db2html-division.xsl b/xslt/docbook/html/db2html-division.xsl index 906ff76..5e4f031 100644 --- a/xslt/docbook/html/db2html-division.xsl +++ b/xslt/docbook/html/db2html-division.xsl @@ -1094,6 +1094,11 @@ REMARK: Describe this template lot | part | preface | reference | setindex | toc "/> <xsl:with-param name="info" select="bookinfo"/> + <!-- Unlike other elements in DocBook, title comes before bookinfo --> + <xsl:with-param name="title_node" + select="(title | bookinfo/title)[1]"/> + <xsl:with-param name="subtitle_node" + select="(subtitle | bookinfo/subtitle)[1]"/> <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/> <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/> <xsl:with-param name="autotoc_depth" select="2"/> |