mirror of
https://github.com/boostorg/boostbook.git
synced 2025-05-09 02:43:58 +00:00
handle admonitions and filerefs
[SVN r25629]
This commit is contained in:
parent
7e44d4d267
commit
c678a081a3
27
xsl/admon.xsl
Normal file
27
xsl/admon.xsl
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
version="1.0">
|
||||
|
||||
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/admon.xsl"/>
|
||||
<xsl:import href="relative-href.xsl"/>
|
||||
|
||||
<xsl:template name="admon.graphic">
|
||||
<xsl:param name="node" select="."/>
|
||||
|
||||
<xsl:call-template name="href.target.relative">
|
||||
<xsl:with-param name="target" select="$admon.graphics.path"/>
|
||||
</xsl:call-template>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="local-name($node)='note'">note</xsl:when>
|
||||
<xsl:when test="local-name($node)='warning'">warning</xsl:when>
|
||||
<xsl:when test="local-name($node)='caution'">caution</xsl:when>
|
||||
<xsl:when test="local-name($node)='tip'">tip</xsl:when>
|
||||
<xsl:when test="local-name($node)='important'">important</xsl:when>
|
||||
<xsl:otherwise>note</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:value-of select="$admon.graphics.extension"/>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
@ -76,4 +76,30 @@
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- ====================================================================== -->
|
||||
|
||||
<xsl:template match="@fileref">
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains(., ':')">
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:variable name="target_uri">
|
||||
<xsl:call-template name="relative-uri">
|
||||
<xsl:with-param name="destdir">
|
||||
<xsl:call-template name="dbhtml-dir">
|
||||
<xsl:with-param name="context" select=".."/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="href.target.relative">
|
||||
<xsl:with-param name="target" select="$target_uri"/>
|
||||
<xsl:with-param name="context" select=".."/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
@ -10,6 +10,7 @@
|
||||
<xsl:import href="chunk-common.xsl"/>
|
||||
<xsl:import href="docbook-layout.xsl"/>
|
||||
<xsl:import href="navbar.xsl"/>
|
||||
<xsl:import href="admon.xsl"/>
|
||||
<xsl:import href="relative-href.xsl"/>
|
||||
|
||||
<xsl:param name="html.stylesheet" select="'boostbook.css'"/>
|
||||
|
@ -2,17 +2,19 @@
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
version="1.0">
|
||||
|
||||
<xsl:import
|
||||
href="http://docbook.sourceforge.net/release/xsl/current/lib/lib.xsl"/>
|
||||
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/lib/lib.xsl"/>
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
|
||||
<xsl:template name="href.target.relative">
|
||||
<xsl:param name="target"/>
|
||||
<xsl:param name="context" select="."/>
|
||||
|
||||
<xsl:variable name="href.to.uri" select="$target"/>
|
||||
<xsl:variable name="href.from.uri">
|
||||
<xsl:call-template name="href.target.uri"/>
|
||||
<xsl:call-template name="href.target.uri">
|
||||
<xsl:with-param name="object" select="$context"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="href.to">
|
||||
|
Loading…
x
Reference in New Issue
Block a user