[gnome-doc-utils/mallard: 80/87] Adding screen support with new mal2html.pre, some CSS tweaks



commit e3716798ef4ba50626965aed1c8b520d78b6fe57
Author: Shaun McCance <shaunm gnome org>
Date:   Wed Dec 17 11:20:06 2008 -0600

    Adding screen support with new mal2html.pre, some CSS tweaks
---
 xslt/mallard/html/mal2html-block.xsl  |   81 ++++++++++++++++++---------------
 xslt/mallard/html/mal2html-css.xsl    |   32 ++++++++-----
 xslt/mallard/html/mal2html-inline.xsl |    9 +++-
 3 files changed, 69 insertions(+), 53 deletions(-)

diff --git a/xslt/mallard/html/mal2html-block.xsl b/xslt/mallard/html/mal2html-block.xsl
index 316d635..ee6ae91 100644
--- a/xslt/mallard/html/mal2html-block.xsl
+++ b/xslt/mallard/html/mal2html-block.xsl
@@ -37,6 +37,9 @@ REMARK: Describe this template
 <xsl:template name="mal2html.block.css">
 <xsl:text>
 div.title {
+  font-size: 1.2em;
+  margin-top: 0;
+  font-weight: bold;
   color: </xsl:text>
   <xsl:call-template name="theme.get_color">
     <xsl:with-param name="id" select="'text-light'"/>
@@ -54,24 +57,14 @@ pre.code {
   <xsl:text>;
   padding: 0.5em 1em 0.5em 1em;
 }
-div.comment {
-  padding: 0.5em;
-  border: solid 2px </xsl:text>
-  <xsl:call-template name="theme.get_color">
-    <xsl:with-param name="id" select="'red-border'"/>
-  </xsl:call-template>
-  <xsl:text>;
-  background-color: </xsl:text>
+div.example {
+  border-left: solid 4px </xsl:text>
   <xsl:call-template name="theme.get_color">
-    <xsl:with-param name="id" select="'red-background'"/>
+    <xsl:with-param name="id" select="'gray-border'"/>
   </xsl:call-template>
   <xsl:text>;
+  padding-left: 1em;
 }
-div.comment div.comment {
-  margin: 1em 0 0 1em;
-}
-div.comment div.cite { margin: 0; font-style: italic; }
-
 div.figure {
   color: </xsl:text>
   <xsl:call-template name="theme.get_color">
@@ -113,16 +106,19 @@ div.figure-contents {
 }
 div.figure div.title { margin: 0 0 4px 0; }
 div.figure div.caption { margin: 4px 0 0 0; }
-
-div.example {
-  border-left: solid 4px </xsl:text>
+pre.screen {
+  background-color: </xsl:text>
+  <xsl:call-template name="theme.get_color">
+    <xsl:with-param name="id" select="'gray-background'"/>
+  </xsl:call-template>
+  <xsl:text>;
+  border: solid 2px </xsl:text>
   <xsl:call-template name="theme.get_color">
     <xsl:with-param name="id" select="'gray-border'"/>
   </xsl:call-template>
   <xsl:text>;
-  padding-left: 1em;
+  padding: 0.5em 1em 0.5em 1em;
 }
-
 div.synopsis {
   border-top: solid 2px;
   border-bottom: solid 2px;
@@ -143,31 +139,22 @@ div.synopsis pre.code {
   border: none;
   padding: 0;
 }
-div.title {
-  font-size: 1.2em;
-  margin-top: 0;
-  font-weight: bold;
-}
 </xsl:text>
 </xsl:template>
 
 
-<!-- == Matched Templates == -->
-
-<!-- = caption = -->
-<xsl:template mode="mal2html.block.mode" match="mal:caption">
-  <div class="caption">
-    <xsl:apply-templates mode="mal2html.block.mode"/>
-  </div>
-</xsl:template>
+<!--**==========================================================================
+mal2html.pre
 
-<!-- = code = -->
-<xsl:template mode="mal2html.block.mode" match="mal:code">
-  <xsl:variable name="first" select="node()[1]/self::text()"/>
-  <xsl:variable name="last" select="node()[last()]/self::text()"/>
+FIXME
+-->
+<xsl:template name="mal2html.pre">
+  <xsl:param name="node" select="."/>
+  <xsl:variable name="first" select="$node/node()[1]/self::text()"/>
+  <xsl:variable name="last" select="$node/node()[last()]/self::text()"/>
   <pre>
     <xsl:attribute name="class">
-      <xsl:text>code</xsl:text>
+      <xsl:value-of select="local-name($node)"/>
       <xsl:if test="not(preceding-sibling::*)">
         <xsl:text> first-child</xsl:text>
       </xsl:if>
@@ -191,6 +178,21 @@ div.title {
   </pre>
 </xsl:template>
 
+
+<!-- == Matched Templates == -->
+
+<!-- = caption = -->
+<xsl:template mode="mal2html.block.mode" match="mal:caption">
+  <div class="caption">
+    <xsl:apply-templates mode="mal2html.block.mode"/>
+  </div>
+</xsl:template>
+
+<!-- = code = -->
+<xsl:template mode="mal2html.block.mode" match="mal:code">
+  <xsl:call-template name="mal2html.pre"/>
+</xsl:template>
+
 <!-- = comment = -->
 <xsl:template mode="mal2html.block.mode" match="mal:comment">
   <div>
@@ -284,6 +286,11 @@ div.title {
   </p>
 </xsl:template>
 
+<!-- = screen = -->
+<xsl:template mode="mal2html.block.mode" match="mal:screen">
+  <xsl:call-template name="mal2html.pre"/>
+</xsl:template>
+
 <!-- = synopsis = -->
 <xsl:template mode="mal2html.block.mode" match="mal:synopsis">
   <div class="synopsis">
diff --git a/xslt/mallard/html/mal2html-css.xsl b/xslt/mallard/html/mal2html-css.xsl
index 0867506..fae4f96 100644
--- a/xslt/mallard/html/mal2html-css.xsl
+++ b/xslt/mallard/html/mal2html-css.xsl
@@ -170,18 +170,8 @@ h5.title { font-size: 1em; }
 h6.title { font-size: 1em; }
 h7.title { font-size: 1em; }
 
-td.twocolumnleft {
-  width: 48%;
-  vertical-align: top;
-  padding: 0;
-  margin: 0;
-}
-td.twocolumnright {
-  width: 52%;
-  vertical-align: top;
-  padding: 0 0 0 1em;
-  margin: 0;
-}
+td.twocolumnleft { width: 48%; vertical-align: top; padding: 0; margin: 0; }
+td.twocolumnright { width: 52%; vertical-align: top; padding: 0 0 0 1em; margin: 0; }
 
 div.pagelink div.title {
   font-size: 1em;
@@ -219,7 +209,6 @@ div.pagelinksep {
   </xsl:call-template>
   <xsl:text>;
 }
-
 </xsl:text>
 <xsl:call-template name="mal2html.css.editor"/>
 <xsl:call-template name="mal2html.css.custom"/>
@@ -326,6 +315,23 @@ div.pagelink div.desc {
   </xsl:call-template>
   <xsl:text>;
 }
+div.comment {
+  padding: 0.5em;
+  border: solid 2px </xsl:text>
+  <xsl:call-template name="theme.get_color">
+    <xsl:with-param name="id" select="'red-border'"/>
+  </xsl:call-template>
+  <xsl:text>;
+  background-color: </xsl:text>
+  <xsl:call-template name="theme.get_color">
+    <xsl:with-param name="id" select="'red-background'"/>
+  </xsl:call-template>
+  <xsl:text>;
+}
+div.comment div.comment {
+  margin: 1em 0 0 1em;
+}
+div.comment div.cite { margin: 0; font-style: italic; }
 </xsl:text>
 </xsl:template>
 
diff --git a/xslt/mallard/html/mal2html-inline.xsl b/xslt/mallard/html/mal2html-inline.xsl
index 644e441..e3286dd 100644
--- a/xslt/mallard/html/mal2html-inline.xsl
+++ b/xslt/mallard/html/mal2html-inline.xsl
@@ -98,9 +98,12 @@ REMARK: Describe this template
 span.app { font-style: italic; }
 span.cmd {
   font-family: monospace;
-  background-color: #f0f0f0;
-  padding-left: 0.2em;
-  padding-right: 0.4em;
+  background-color: </xsl:text>
+  <xsl:call-template name="theme.get_color">
+    <xsl:with-param name="id" select="'gray-background'"/>
+  </xsl:call-template>
+  <xsl:text>;
+  padding: 0 0.2em 0 0.2em;
 }
 span.code { font-family: monospace; }
 span.em { font-style: italic; }



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