svn commit: r42234 - in projects/db5/share: mk xsl

Gabor Kovesdan gabor at FreeBSD.org
Wed Jul 10 10:38:07 UTC 2013


Author: gabor
Date: Wed Jul 10 10:38:06 2013
New Revision: 42234
URL: http://svnweb.freebsd.org/changeset/doc/42234

Log:
  - Workaround for dblatex escaping in <filename>

Added:
  projects/db5/share/xsl/freebsd-dblatex.xsl   (contents, props changed)
Modified:
  projects/db5/share/mk/doc.docbook.mk

Modified: projects/db5/share/mk/doc.docbook.mk
==============================================================================
--- projects/db5/share/mk/doc.docbook.mk	Wed Jul 10 10:05:37 2013	(r42233)
+++ projects/db5/share/mk/doc.docbook.mk	Wed Jul 10 10:38:06 2013	(r42234)
@@ -75,7 +75,7 @@ IMAGES_LIB?=
 SCHEMATRONS?=	${DOC_PREFIX}/share/xml/freebsd.sch
 XSLTPROCOPTS?=	--nonet
 
-DBLATEXOPTS?=	-I ${IMAGES_EN_DIR}/${DOC}s/${.CURDIR:T} -T simple -d
+DBLATEXOPTS?=	-I ${IMAGES_EN_DIR}/${DOC}s/${.CURDIR:T} -p ${DOC_PREFIX}/share/xsl/freebsd-dblatex.xsl -T simple -d
 
 KNOWN_FORMATS=	html html.tar html-split html-split.tar \
 		epub txt rtf ps pdf tex dvi tar pdb

Added: projects/db5/share/xsl/freebsd-dblatex.xsl
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/db5/share/xsl/freebsd-dblatex.xsl	Wed Jul 10 10:38:06 2013	(r42234)
@@ -0,0 +1,36 @@
+<?xml version='1.0' encoding="iso-8859-1"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+		xmlns:str="http://exslt.org/strings"
+		extension-element-prefixes="str"
+		version='1.0'>
+
+  <!-- $FreeBSD$ -->
+
+  <xsl:template match="filename">
+    <xsl:choose>
+    <!-- \Url cannot stand in a section heading -->
+    <xsl:when test="$filename.as.url='1' and
+      not(ancestor::title or ancestor::refentrytitle)">
+    <xsl:text>\nolinkurl{</xsl:text><xsl:apply-templates mode="tex.escape"/><xsl:text>}</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="inline.monoseq"/>
+    </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+ 
+  <xsl:template match="text()" mode="tex.escape">
+    <xsl:variable name="t1" select="str:replace(., '\', '\\')"/>
+    <xsl:variable name="t2" select="str:replace($t1, '^', '\^')"/>
+    <xsl:variable name="t3" select="str:replace($t2, '~', '\~')"/>
+    <xsl:variable name="t4" select="str:replace($t3, '{', '\{')"/>
+    <xsl:variable name="t5" select="str:replace($t4, '}', '\}')"/>
+    <xsl:variable name="t6" select="str:replace($t5, '%', '\%')"/>
+    <xsl:variable name="t7" select="str:replace($t6, '$', '\$')"/>
+    <xsl:variable name="t8" select="str:replace($t7, '&', '\&')"/>
+    <xsl:variable name="t9" select="str:replace($t8, '#', '\#')"/>
+    <xsl:variable name="t10" select="str:replace($t9, '_', '\_')"/>
+
+    <xsl:value-of select="$t10"/>
+  </xsl:template>
+</xsl:stylesheet>


More information about the svn-doc-projects mailing list