]> granicus.if.org Git - postgresql/commitdiff
doc: Improve PDF bookmarks
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 15 Aug 2017 18:37:44 +0000 (14:37 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 15 Aug 2017 18:47:03 +0000 (14:47 -0400)
Also create PDF bookmarks/ToC entries for subsections of reference
pages.  This was a regression from the previous jadetex-based build.

Reported-by: Erik Rijkers <er@xs4all.nl>
doc/src/sgml/stylesheet-fo.xsl

index 7a0fbe9564fb9f25a71c289a075baf51fbc1b8d0..ea754084be0d53e6acfe732003d83ab48bb5c9bb 100644 (file)
   <xsl:apply-templates mode="no.anchor.mode"/>
 </xsl:template>
 
+<!-- include refsects in PDF bookmarks
+     (https://github.com/docbook/xslt10-stylesheets/issues/46) -->
+
+<xsl:template match="refsect1|refsect2|refsect3"
+              mode="bookmark">
+
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+  <xsl:variable name="bookmark-label">
+    <xsl:apply-templates select="." mode="object.title.markup"/>
+  </xsl:variable>
+
+  <fo:bookmark internal-destination="{$id}">
+    <xsl:attribute name="starting-state">
+      <xsl:value-of select="$bookmarks.state"/>
+    </xsl:attribute>
+    <fo:bookmark-title>
+      <xsl:value-of select="normalize-space($bookmark-label)"/>
+    </fo:bookmark-title>
+    <xsl:apply-templates select="*" mode="bookmark"/>
+  </fo:bookmark>
+</xsl:template>
+
 </xsl:stylesheet>