[yelp-xsl/wip/html5] Add html.output.prefix param
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp-xsl/wip/html5] Add html.output.prefix param
- Date: Mon, 3 Oct 2016 17:47:56 +0000 (UTC)
commit 8fcd09d88ab1bbd9215733683cee0ce831592757
Author: Shaun McCance <shaunm gnome org>
Date: Mon Oct 3 13:47:05 2016 -0400
Add html.output.prefix param
Sometimes it's not feasible to control the output directory externally
to the stylesheets, so we now allow you to control it here.
xslt/common/html.xsl | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/xslt/common/html.xsl b/xslt/common/html.xsl
index 0a27181..1a16366 100644
--- a/xslt/common/html.xsl
+++ b/xslt/common/html.xsl
@@ -212,6 +212,19 @@ time by JavaScript.
<xsl:param name="html.syntax.highlight" select="true()"/>
+<!--@@==========================================================================
+html.output.prefix
+An optional path prefix for files output with *{html.output}.
+:Revision:version="3.next" date="2016-10-03" status="review"
+
+This parameter allows you to specify an prefix to place before the output path
+used by *{html.output} when creating files. You can use this to override the
+output directory. Make sure you include a trailing slash, unless you want to
+prefix the base file name itself.
+-->
+<xsl:param name="html.output.prefix" select="''"/>
+
+
<!--**==========================================================================
html.output
Create an HTML output file.
@@ -229,6 +242,10 @@ as follows: If an #{xml:id} attribute is present, it is used; otherwise, if
an #{id} attribute is present, it is uses; otherwise, if ${node} is the root
element, @{html.basename} is used; otherwise, #{generate-id()} is called.
+This template prepends @{html.output.prefix} to the value of ${href} when
+it calls #{exsl:document}, regardless of whether ${href} was passed in or
+generated automatically.
+
After calling #{exsl:document}, this template calls the %{html.output.after.mode}
mode on ${node}. Importing stylesheets that create multiple output files can
use this to process output files without blocking earlier output.
@@ -253,14 +270,14 @@ use this to process output files without blocking earlier output.
</xsl:param>
<xsl:choose>
<xsl:when test="$html.xhtml">
- <exsl:document href="{$href}">
+ <exsl:document href="{$html.output.prefix}{$href}">
<xsl:call-template name="html.page">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
</exsl:document>
</xsl:when>
<xsl:otherwise>
- <exsl:document href="{$href}" method="html"
+ <exsl:document href="{$html.output.prefix}{$href}" method="html"
doctype-system="about:legacy-compat">
<xsl:call-template name="html.page">
<xsl:with-param name="node" select="$node"/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]