[yelp] [info2html.xsl] Using common CSS for info documents



commit e692616ad3ce74cd12c35e1d65609f8eedabd129
Author: Shaun McCance <shaunm gnome org>
Date:   Tue Apr 27 11:04:48 2010 -0500

    [info2html.xsl] Using common CSS for info documents

 .gitignore                   |    1 +
 configure.in                 |    8 +++
 stylesheets/Makefile.am      |    9 +++-
 stylesheets/info2html.xsl    |  127 ------------------------------------------
 stylesheets/info2html.xsl.in |   91 ++++++++++++++++++++++++++++++
 5 files changed, 108 insertions(+), 128 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 44f3ca6..4ea3e1c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -86,6 +86,7 @@ Makefile.in
 /stamp-h1
 /stylesheets/db-title.xsl
 /stylesheets/db2html.xsl
+/stylesheets/info2html.xsl
 /stylesheets/mal2html.xsl
 /stylesheets/toc2html.xsl
 /stylesheets/yelp-common.xsl
diff --git a/configure.in b/configure.in
index fe755bf..b56bb51 100644
--- a/configure.in
+++ b/configure.in
@@ -91,6 +91,13 @@ AC_SUBST(XSL_DB2XHTML)
 XSL_MAL2XHTML="`$PKG_CONFIG --variable=mal2xhtml yelp-xsl`"
 AC_SUBST(XSL_MAL2XHTML)
 
+XSL_THEME_COLORS="`$PKG_CONFIG --variable=xsltdir yelp-xsl`/theme/theme-colors.xsl"
+AC_SUBST(XSL_THEME_COLORS)
+XSL_THEME_ICONS="`$PKG_CONFIG --variable=xsltdir yelp-xsl`/theme/theme-icons.xsl"
+AC_SUBST(XSL_THEME_ICONS)
+XSL_THEME_HTML="`$PKG_CONFIG --variable=xsltdir yelp-xsl`/theme/theme-html.xsl"
+AC_SUBST(XSL_THEME_HTML)
+
 XSL_GETTEXT="`$PKG_CONFIG --variable=gettext yelp-xsl`"
 AC_SUBST(XSL_GETTEXT)
 
@@ -268,6 +275,7 @@ src/Makefile
 stylesheets/Makefile
 stylesheets/db2html.xsl
 stylesheets/db-title.xsl
+stylesheets/info2html.xsl
 stylesheets/mal2html.xsl
 stylesheets/toc2html.xsl
 stylesheets/yelp-common.xsl
diff --git a/stylesheets/Makefile.am b/stylesheets/Makefile.am
index d8f0b58..996b0d0 100644
--- a/stylesheets/Makefile.am
+++ b/stylesheets/Makefile.am
@@ -12,4 +12,11 @@ xsl_DATA =		\
 	toc2html.xsl	\
 	yelp-common.xsl
 
-EXTRA_DIST=$(xsl_DATA) db2html.xsl.in db-title.xsl.in mal2html.xsl.in toc2html.xsl.in yelp-common.xsl.in
+EXTRA_DIST=			\
+	$(xsl_DATA)		\
+	db2html.xsl.in		\
+	db-title.xsl.in		\
+	info2html.xsl.in	\
+	mal2html.xsl.in		\
+	toc2html.xsl.in		\
+	yelp-common.xsl.in
diff --git a/stylesheets/info2html.xsl.in b/stylesheets/info2html.xsl.in
new file mode 100644
index 0000000..fb5619f
--- /dev/null
+++ b/stylesheets/info2html.xsl.in
@@ -0,0 +1,91 @@
+<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                xmlns:yelp="http://www.gnome.org/yelp/ns";
+                xmlns="http://www.w3.org/1999/xhtml";
+                extension-element-prefixes="yelp"
+                version="1.0">
+
+<xsl:import href="@XSL_GETTEXT@"/>
+<xsl:import href="@XSL_THEME_COLORS@"/>
+<xsl:import href="@XSL_THEME_ICONS@"/>
+<xsl:import href="@XSL_THEME_HTML@"/>
+<xsl:include href="yelp-common.xsl"/>
+
+<xsl:template match="/Info">
+  <xsl:apply-templates select="Section"/>
+</xsl:template>
+
+<xsl:template match="Section">
+  <yelp:document href="{ id}">
+    <html>
+      <head>
+        <title>
+          <xsl:value-of select="@name"/>
+        </title>
+        <style type="text/css">
+          <xsl:call-template name="html.css"/>
+        </style>
+      </head>
+      <body>
+        <div class="head"/>
+        <div class="body">
+          <xsl:apply-templates select="node()[not(self::Section)]"/>
+        </div>
+        <div class="foot"/>
+      </body>
+    </html>
+  </yelp:document>
+  <xsl:apply-templates select="Section"/>
+</xsl:template>
+
+<xsl:template match="para">
+  <xsl:value-of select="node()"/>
+  <xsl:text>
+  </xsl:text>
+</xsl:template>
+
+<xsl:template match="para1">
+  <xsl:value-of select="node()"/>
+</xsl:template>
+
+<xsl:template match="spacing">
+  <xsl:value-of select="node()"/>
+</xsl:template>
+
+<xsl:template match="a">
+  <xsl:element name="a">
+    <xsl:attribute name="href">
+      <xsl:value-of select="@href"/>
+    </xsl:attribute>
+    <xsl:value-of select="node()"/>
+  </xsl:element>
+</xsl:template>
+
+<xsl:template match="img">
+  <xsl:element name="a">
+    <xsl:attribute name="href">
+      <xsl:value-of select="@src"/>
+    </xsl:attribute>
+    <xsl:element name="img">
+      <xsl:attribute name="src"> <xsl:value-of select="@src"/></xsl:attribute>
+    </xsl:element>
+  </xsl:element>
+</xsl:template>
+
+<xsl:template match="menuholder">
+  <xsl:apply-templates select="node()[not(self::menuholder)]"/>
+</xsl:template>
+
+<xsl:template match="noteholder">
+  <xsl:apply-templates select="node()[not(self::noteholder)]"/>
+</xsl:template>
+
+<xsl:template name="html.css">
+  <xsl:call-template name="theme.html.css"/>
+  <xsl:text>
+body { white-space: pre; font-family: monospace; }
+</xsl:text>
+</xsl:template>
+
+</xsl:stylesheet>



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