diff options
author | Shaun McCance <shaunm@gnome.org> | 2009-06-01 02:58:51 -0500 |
---|---|---|
committer | Shaun McCance <shaunm@gnome.org> | 2009-06-01 02:58:51 -0500 |
commit | b6eb32f41becc5550c1f512ea7635de786d7ac3b (patch) | |
tree | 0935d18b820fc2749881fe1f79565181a72bca11 /xslt | |
parent | be7d9e4a7349bc10bd9c162b5a4b306872b17b43 (diff) | |
download | gnome-doc-utils-b6eb32f41becc5550c1f512ea7635de786d7ac3b.tar.gz |
Build and stylesheet changes prepping for Yelp work
Diffstat (limited to 'xslt')
-rw-r--r-- | xslt/docbook/html/db2xhtml.xsl | 2 | ||||
-rw-r--r-- | xslt/mallard/common/Makefile.am | 2 | ||||
-rw-r--r-- | xslt/mallard/common/mal-chunk.xsl | 85 | ||||
-rw-r--r-- | xslt/mallard/common/mal-link.xsl | 4 | ||||
-rw-r--r-- | xslt/mallard/html/mal2html-page.xsl | 26 | ||||
-rw-r--r-- | xslt/mallard/html/mal2html.xsl | 11 | ||||
-rw-r--r-- | xslt/mallard/html/mal2xhtml.xsl | 16 |
7 files changed, 134 insertions, 12 deletions
diff --git a/xslt/docbook/html/db2xhtml.xsl b/xslt/docbook/html/db2xhtml.xsl index 629e415..d043983 100644 --- a/xslt/docbook/html/db2xhtml.xsl +++ b/xslt/docbook/html/db2xhtml.xsl @@ -28,7 +28,7 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA <!--#@ db.chunk.doctype_system --> <xsl:param name="db.chunk.doctype_system" select="'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'"/> -<xsl:output method="html" +<xsl:output method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/> diff --git a/xslt/mallard/common/Makefile.am b/xslt/mallard/common/Makefile.am index 9c808fc..9501408 100644 --- a/xslt/mallard/common/Makefile.am +++ b/xslt/mallard/common/Makefile.am @@ -1,5 +1,5 @@ xsldir=$(datadir)/xml/gnome/xslt/mallard/common -xsl_DATA = mal-link.xsl +xsl_DATA = mal-chunk.xsl mal-link.xsl EXTRA_DIST=$(xsl_DATA) diff --git a/xslt/mallard/common/mal-chunk.xsl b/xslt/mallard/common/mal-chunk.xsl new file mode 100644 index 0000000..72531c3 --- /dev/null +++ b/xslt/mallard/common/mal-chunk.xsl @@ -0,0 +1,85 @@ +<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- --> +<!-- +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free +Software Foundation; either version 2 of the License, or (at your option) any +later version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +details. + +You should have received a copy of the GNU Lesser General Public License +along with this program; see the file COPYING.LGPL. If not, write to the +Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. +--> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:exsl="http://exslt.org/common" + extension-element-prefixes="exsl" + version="1.0"> + +<!--!!========================================================================== +Chunking + +REMARK: Describe this module +--> + + +<!--@@========================================================================== +mal.chunk.chunk_top +Whether the top-level page should be output with the chunking mechanism + +REMARK: Describe what this does +--> +<xsl:param name="mal.chunk.chunk_top" select="false()"/> + + +<!--@@========================================================================== +mal.chunk.extension +The default file extension for new output documents + +REMARK: Describe what this does +--> +<xsl:param name="mal.chunk.extension"/> + + +<!--@@========================================================================== +mal.chunk.doctype_public +The public DOCTYPE for output files + +REMARK: Describe this +--> +<xsl:param name="mal.chunk.doctype_public"/> + + +<!--@@========================================================================== +mal.chunk.doctype_system +The system DOCTYPE for output files + +REMARK: Describe this +--> +<xsl:param name="mal.chunk.doctype_system"/> + + +<!--**========================================================================== +mal.chunk +Creates a new page of output +$node: The source element for the output page +$href: The name of the file for the output page + +REMARK: Describe +--> +<xsl:template name="mal.chunk"> + <xsl:param name="node" select="."/> + <xsl:param name="href" select="concat($node/@id, $mal.chunk.extension)"/> + <exsl:document href="{$href}" + doctype-public="{$mal.chunk.doctype_public}" + doctype-system="{$mal.chunk.doctype_system}"> + <xsl:apply-templates mode="mal.chunk.content.mode" select="$node"/> + </exsl:document> +</xsl:template> + +</xsl:stylesheet> diff --git a/xslt/mallard/common/mal-link.xsl b/xslt/mallard/common/mal-link.xsl index de5817d..fd00a77 100644 --- a/xslt/mallard/common/mal-link.xsl +++ b/xslt/mallard/common/mal-link.xsl @@ -127,12 +127,12 @@ $href: The #{href} attribute of ${link} <xsl:variable name="pageid" select="substring-before($xref, '#')"/> <xsl:variable name="sectionid" select="substring-after($xref, '#')"/> <xsl:if test="$pageid != ''"> - <xsl:value-of select="concat($pageid, $mal.extension)"/> + <xsl:value-of select="concat($pageid, $mal.chunk.extension)"/> </xsl:if> <xsl:value-of select="concat('#', $sectionid)"/> </xsl:when> <xsl:otherwise> - <xsl:value-of select="concat($xref, $mal.extension)"/> + <xsl:value-of select="concat($xref, $mal.chunk.extension)"/> </xsl:otherwise> </xsl:choose> </xsl:template> diff --git a/xslt/mallard/html/mal2html-page.xsl b/xslt/mallard/html/mal2html-page.xsl index 01be58a..cc96415 100644 --- a/xslt/mallard/html/mal2html-page.xsl +++ b/xslt/mallard/html/mal2html-page.xsl @@ -465,9 +465,23 @@ REMARK: Describe this template <!-- = / = --> <xsl:template match="/"> + <xsl:choose> + <xsl:when test="$mal.chunk.chunk_top"> + <xsl:call-template name="mal.chunk"> + <xsl:with-param name="node" select="mal:page"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates mode="mal.chunk.content.mode" select="mal:page"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- = mal:page % mal.chunk.content.mode = --> +<xsl:template mode="mal.chunk.content.mode" match="mal:page"> <!-- FIXME: find a way to just select the version element --> <xsl:variable name="date"> - <xsl:for-each select="mal:page/mal:info/mal:revision"> + <xsl:for-each select="mal:info/mal:revision"> <xsl:sort select="@date" data-type="text" order="descending"/> <xsl:if test="position() = 1"> <xsl:value-of select="@date"/> @@ -475,17 +489,17 @@ REMARK: Describe this template </xsl:for-each> </xsl:variable> <xsl:variable name="revision" - select="mal:page/mal:info/mal:revision[@date = $date][last()]"/> + select="mal:info/mal:revision[@date = $date][last()]"/> <html> <head> <title> - <xsl:value-of select="mal:page/mal:title"/> + <xsl:value-of select="mal:title"/> </title> <xsl:call-template name="mal2html.css"/> </head> <body> <xsl:call-template name="mal2html.page.linktrails"> - <xsl:with-param name="node" select="mal:page"/> + <xsl:with-param name="node" select="."/> </xsl:call-template> <div class="body"> <xsl:if test="$mal2html.editor_mode and $revision/@status != ''"> @@ -519,10 +533,10 @@ REMARK: Describe this template <xsl:apply-templates mode="mal2html.block.mode" select="$revision/*"/> </div> </xsl:if> - <xsl:apply-templates select="mal:page"/> + <xsl:apply-templates select="."/> </div> <xsl:call-template name="db2html.page.copyrights"> - <xsl:with-param name="node" select="mal:page"/> + <xsl:with-param name="node" select="."/> </xsl:call-template> </body> </html> diff --git a/xslt/mallard/html/mal2html.xsl b/xslt/mallard/html/mal2html.xsl index 441c57b..6a4e5de 100644 --- a/xslt/mallard/html/mal2html.xsl +++ b/xslt/mallard/html/mal2html.xsl @@ -22,6 +22,14 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA exclude-result-prefixes="mal" version="1.0"> +<xsl:import href="../../gettext/gettext.xsl"/> + +<!--#@ mal.chunk.doctype_public --> +<xsl:param name="mal.chunk.doctype_public" select="'-//W3C//DTD HTML 4.01 Transitional//EN'"/> + +<!--#@ mal.chunk.doctype_system --> +<xsl:param name="mal.chunk.doctype_system" select="'http://www.w3.org/TR/html4/loose.dtd'"/> + <xsl:output method="html" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/loose.dtd"/> @@ -30,7 +38,7 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA <!--#@ mal2html.namespace --> <xsl:param name="mal2html.namespace" select="''"/> -<xsl:param name="mal.extension" select="'.html'"/> +<xsl:param name="mal.chunk.extension" select="'.html'"/> <!--!!========================================================================== @@ -39,6 +47,7 @@ Mallard to HTML REMARK: Describe this module --> +<xsl:include href="../common/mal-chunk.xsl"/> <xsl:include href="../common/mal-link.xsl"/> <xsl:include href="mal2html-block.xsl"/> diff --git a/xslt/mallard/html/mal2xhtml.xsl b/xslt/mallard/html/mal2xhtml.xsl index df7a07d..2f556e7 100644 --- a/xslt/mallard/html/mal2xhtml.xsl +++ b/xslt/mallard/html/mal2xhtml.xsl @@ -22,10 +22,23 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA exclude-result-prefixes="mal" version="1.0"> + +<xsl:import href="../../gettext/gettext.xsl"/> + +<!--#@ mal.chunk.doctype_public --> +<xsl:param name="mal.chunk.doctype_public" select="'-//W3C//DTD XHTML 1.0 Strict//EN'"/> + +<!--#@ mal.chunk.doctype_system --> +<xsl:param name="mal.chunk.doctype_system" select="'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'"/> + +<xsl:output method="xml" + doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" + doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/> + <!--#@ mal2html.namespace --> <xsl:param name="mal2html.namespace" select="'http://www.w3.org/1999/xhtml'"/> -<xsl:param name="mal.extension" select="'.xhtml'"/> +<xsl:param name="mal.chunk.extension" select="'.xhtml'"/> <!--!!========================================================================== Mallard to HTML @@ -33,6 +46,7 @@ Mallard to HTML REMARK: Describe this module --> +<xsl:include href="../common/mal-chunk.xsl"/> <xsl:include href="../common/mal-link.xsl"/> <xsl:include href="mal2html-block.xsl"/> |