[gnome-doc-utils/mallard] [mal2html] Using the dual-(x)html output method from db2html



commit fc0cdea95ef540bccce4135eca88129f2b0c3938
Author: Shaun McCance <shaunm gnome org>
Date:   Mon May 11 12:54:25 2009 -0500

    [mal2html] Using the dual-(x)html output method from db2html
---
 sandbox/mallard/html/Makefile       |    7 ++--
 xslt/mallard/html/mal2html-page.xsl |    4 +-
 xslt/mallard/html/mal2html.xsl      |   16 +++++++--
 xslt/mallard/html/mal2xhtml.xsl     |   67 +++++++++++++++++++++++++++++++++++
 4 files changed, 86 insertions(+), 8 deletions(-)

diff --git a/sandbox/mallard/html/Makefile b/sandbox/mallard/html/Makefile
index a45cbef..8781306 100644
--- a/sandbox/mallard/html/Makefile
+++ b/sandbox/mallard/html/Makefile
@@ -1,6 +1,6 @@
 xslts=$(wildcard ../../../xslt/mallard/common/*.xsl) $(wildcard ../../../xslt/mallard/html/*.xsl)
 specs=$(filter-out ../../../doc/mallard/C/legal.xml, $(wildcard ../../../doc/mallard/C/*.xml))
-pages=$(patsubst %.xml,%.xhtml, $(notdir $(specs)))
+pages=$(patsubst %.xml,%.html, $(notdir $(specs)))
 
 all: $(pages) figures mallard.cache
 
@@ -14,9 +14,10 @@ mallard.cache : $(specs) $(xslts)
 	rm $  in
 
 $(pages) : mallard.cache $(xslts)
-$(pages) : %.xhtml : ../../../doc/mallard/C/%.xml
+$(pages) : %.html : ../../../doc/mallard/C/%.xml
 	xsltproc -o $@ \
 	  --stringparam mal.cache.file `pwd`/mallard.cache \
+	  --param mal2html.editor_mode 1 \
 	  ../../../xslt/mallard/html/mal2html.xsl $<
 
 figures:
@@ -25,4 +26,4 @@ figures:
 
 .PHONY: clean
 clean:
-	rm mallard.cache *.xhtml
+	rm mallard.cache *.html
diff --git a/xslt/mallard/html/mal2html-page.xsl b/xslt/mallard/html/mal2html-page.xsl
index 81c6430..e4e84bd 100644
--- a/xslt/mallard/html/mal2html-page.xsl
+++ b/xslt/mallard/html/mal2html-page.xsl
@@ -268,7 +268,7 @@ REMARK: Describe this template
   <xsl:if test="$inlinks or $outlinks or $pagelinks or $guidelinks">
     <div class="section autolinkssection">
       <div class="header">
-        <xsl:element name="{concat('h', $depth)}">
+        <xsl:element name="{concat('h', $depth)}" namespace="{$mal2html.namespace}">
           <xsl:attribute name="class">
             <xsl:text>title</xsl:text>
           </xsl:attribute>
@@ -484,7 +484,7 @@ REMARK: Describe this template
 <xsl:template mode="mal2html.title.mode" match="mal:title">
   <xsl:variable name="depth"
                 select="count(ancestor::mal:section) + 1"/>
-  <xsl:element name="{concat('h', $depth)}">
+  <xsl:element name="{concat('h', $depth)}" namespace="{$mal2html.namespace}">
     <xsl:attribute name="class">
       <xsl:text>title</xsl:text>
     </xsl:attribute>
diff --git a/xslt/mallard/html/mal2html.xsl b/xslt/mallard/html/mal2html.xsl
index 9b62be9..21e46d0 100644
--- a/xslt/mallard/html/mal2html.xsl
+++ b/xslt/mallard/html/mal2html.xsl
@@ -18,9 +18,21 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                 xmlns:mal="http://www.gnome.org/~shaunm/mallard";
-                xmlns="http://www.w3.org/1999/xhtml";
+                xmlns:html="http://www.w3.org/1999/xhtml";
+                exclude-result-prefixes="mal"
                 version="1.0">
 
+<xsl:output method="html"
+            doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
+            doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
+<xsl:namespace-alias stylesheet-prefix="html" result-prefix="#default"/>
+
+<!--#@ mal2html.namespace -->
+<xsl:param name="mal2html.namespace" select="''"/>
+
+<xsl:param name="mal.extension" select="'.html'"/>
+
+
 <!--!!==========================================================================
 Mallard to HTML
 
@@ -40,8 +52,6 @@ REMARK: Describe this module
 <xsl:include href="theme.xsl"/>
 <xsl:include href="util.xsl"/>
 
-<xsl:param name="mal.extension" select="'.xhtml'"/>
-
 <!-- FIXME -->
 <xsl:template match="*">
   <xsl:message>
diff --git a/xslt/mallard/html/mal2xhtml.xsl b/xslt/mallard/html/mal2xhtml.xsl
new file mode 100644
index 0000000..5a94063
--- /dev/null
+++ b/xslt/mallard/html/mal2xhtml.xsl
@@ -0,0 +1,67 @@
+<?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:mal="http://www.gnome.org/~shaunm/mallard";
+                xmlns="http://www.w3.org/1999/xhtml";
+                exclude-result-prefixes="mal"
+                version="1.0">
+
+<!--#@ mal2html.namespace -->
+<xsl:param name="mal2html.namespace" select="'http://www.w3.org/1999/xhtml'"/>
+
+<xsl:param name="mal.extension" select="'.xhtml'"/>
+
+<!--!!==========================================================================
+Mallard to HTML
+
+REMARK: Describe this module
+-->
+
+<xsl:include href="../common/mal-link.xsl"/>
+
+<xsl:include href="mal2html-block.xsl"/>
+<xsl:include href="mal2html-css.xsl"/>
+<xsl:include href="mal2html-inline.xsl"/>
+<xsl:include href="mal2html-list.xsl"/>
+<xsl:include href="mal2html-media.xsl"/>
+<xsl:include href="mal2html-page.xsl"/>
+<xsl:include href="mal2html-table.xsl"/>
+
+<xsl:include href="theme.xsl"/>
+<xsl:include href="util.xsl"/>
+
+<!-- FIXME -->
+<xsl:template match="*">
+  <xsl:message>
+    <xsl:text>Unmatched element: </xsl:text>
+    <xsl:value-of select="local-name(.)"/>
+  </xsl:message>
+  <xsl:apply-templates/>
+</xsl:template>
+
+<!-- FIXME -->
+<xsl:template name="l10n.gettext">
+  <xsl:param name="msgid" select="'email.tooltip'"/>
+  <xsl:value-of select="$msgid"/>
+</xsl:template>
+<xsl:template name="l10n.direction">
+  <xsl:text>ltr</xsl:text>
+</xsl:template>
+
+</xsl:stylesheet>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]