[yelp-xsl] [theme-html] Adding some inline styling to common CSS



commit 85242a78b7b8d5e713fa9627f1a153e9b5eac174
Author: Shaun McCance <shaunm gnome org>
Date:   Mon Mar 1 19:17:11 2010 -0600

    [theme-html] Adding some inline styling to common CSS

 test/testdocs/inline.x001.xml               |   11 ++-
 xslt/docbook/html/db2html-classsynopsis.xsl |    8 --
 xslt/docbook/html/db2html-css.xsl           |   35 +---------
 xslt/docbook/html/db2html-inline.xsl        |  105 +++++++++++++++------------
 xslt/mallard/html/mal2html-css.xsl          |   14 ----
 xslt/theme/theme-html.xsl                   |   22 ++++++
 6 files changed, 90 insertions(+), 105 deletions(-)
---
diff --git a/test/testdocs/inline.x001.xml b/test/testdocs/inline.x001.xml
index a7af70b..7fbee97 100644
--- a/test/testdocs/inline.x001.xml
+++ b/test/testdocs/inline.x001.xml
@@ -59,7 +59,12 @@
 <para><mousebutton>mousebutton</mousebutton></para>
 <para><option>option</option></para>
 <para><optional>optional</optional></para>
-<para><parameter>parameter</parameter></para>
+<para>
+<parameter>parameter</parameter>
+<parameter class="command">command</parameter>
+<parameter class="function">function</parameter>
+<parameter class="option">option</parameter>
+</para>
 <para><phrase>phrase</phrase></para>
 <para><productname>productname</productname></para>
 <para><productnumber>productnumber</productnumber></para>
@@ -70,8 +75,8 @@
 <para><sgmltag>sgmltag</sgmltag></para>
 <para><structfield>structfield</structfield></para>
 <para><structname>structname</structname></para>
-<para><subscript>subscript</subscript></para>
-<para><superscript>superscript</superscript></para>
+<para>sub<subscript>script</subscript></para>
+<para>super<superscript>script</superscript></para>
 <para><symbol>symbol</symbol></para>
 <para><systemitem>systemitem</systemitem></para>
 <para><token>token</token></para>
diff --git a/xslt/docbook/html/db2html-classsynopsis.xsl b/xslt/docbook/html/db2html-classsynopsis.xsl
index 96975a2..3359a0e 100644
--- a/xslt/docbook/html/db2html-classsynopsis.xsl
+++ b/xslt/docbook/html/db2html-classsynopsis.xsl
@@ -127,14 +127,6 @@ REMARK: Describe this param
   </span>
 </xsl:template>
 
-<!-- = methodparam/parameter = -->
-<xsl:template match="methodparam/parameter">
-  <xsl:call-template name="db2html.inline">
-    <xsl:with-param name="mono" select="true()"/>
-    <xsl:with-param name="italic" select="true()"/>
-  </xsl:call-template>
-</xsl:template>
-
 <!--#* db2html.class.cpp.modifier -->
 <xsl:template name="db2html.class.cpp.modifier">
   <!-- For C++, we expect the first modifier to be the visibility -->
diff --git a/xslt/docbook/html/db2html-css.xsl b/xslt/docbook/html/db2html-css.xsl
index 10ba0a7..3b993a2 100644
--- a/xslt/docbook/html/db2html-css.xsl
+++ b/xslt/docbook/html/db2html-css.xsl
@@ -252,26 +252,7 @@ div.simplelist td.td-first {
 */
 
 span.accel { text-decoration: underline; }
-span.acronym { font-family: sans-serif; }
-span.application { font-style: italic; }
-span.classname, span.exceptionname, span.interfacename { font-family: monospace; }
-span.code {
-  font-family: monospace;
-  border: solid 1px </xsl:text><xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
-  padding-left: 0.2em;
-  padding-right: 0.2em;
-}
-pre span.code { border: none; padding: 0; }
-span.command {
-  font-family: monospace;
-  border: solid 1px </xsl:text><xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
-  padding-left: 0.2em;
-  padding-right: 0.2em;
-}
-pre span.command { border: none; padding: 0; }
-span.computeroutput { font-family: monospace; }
 <!-- FIXME: stderr red text -->
-span.constant { font-family: monospace; }
 span.database { font-family: monospace; }
 span.email { font-family: monospace; }
 span.emphasis { font-style: italic; }
@@ -292,36 +273,22 @@ dd.glossdef, dd.glosssee, dd.glossseealso { margin-top: 0em;  margin-bottom: 0;
 
 span.glossterm { font-style: italic; }
 
-span.guibutton, span.guilabel, span.guimenu, span.guimenuitem, span.guisubmenu, span.interface {
-  font-weight: bold;
-  color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
-}
 span.keycap {
   font-weight: bold;
   color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
 }
 span.lineannotation { font-style: italic; }
 span.literal { font-family: monospace; }
-span.markup  { font-family: monospace; }
 span.medialabel { font-style: italic; }
-span.methodname { font-family: monospace; }
 span.ooclass, span.ooexception, span.oointerface { font-family: monospace; }
 span.option { font-family: monospace; }
-span.parameter { font-family: monospace; }
+.methodparam span.parameter { font-style: italic; }
 span.paramdef span.parameter { font-style: italic; }
 span.prompt { font-family: monospace; }
 span.property { font-family: monospace; }
-span.replaceable  { font-style: italic; }
-span.returnvalue { font-family: monospace; }
 span.sgmltag { font-family: monospace; }
-span.structfield, span.structname { font-family: monospace; }
 span.symbol { font-family: monospace; }
-span.systemitem { font-family: monospace; }
 span.token { font-family: monospace; }
-span.type { font-family: monospace; }
-span.uri { font-family: monospace; }
-span.userinput { font-family: monospace; }
-span.varname { font-family: monospace; }
 span.wordasword { font-style: italic; }
 <!-- FIXME below -->
 
diff --git a/xslt/docbook/html/db2html-inline.xsl b/xslt/docbook/html/db2html-inline.xsl
index bf53f49..e81ea37 100644
--- a/xslt/docbook/html/db2html-inline.xsl
+++ b/xslt/docbook/html/db2html-inline.xsl
@@ -36,11 +36,6 @@ Renders an inline element as an HTML #{span} element
 $node: The element to render
 $children: The child elements to process
 $class: The value of the #{class} attribute on the #{span} tag
-$bold: Whether to render the element in bold face
-$italic: Whether to render the element in italics
-$underline: Whether to underline the element
-$mono: Whether to render the element in a monospace font
-$sans: Whether to render the element in a sans-serif font
 $lang: The locale of the text in ${node}
 $dir: The text direction, either #{ltr} or #{rtl}
 $ltr: Whether to default to #{ltr} if neither ${lang} nor ${dir} is specified
@@ -50,18 +45,13 @@ REMARK: Document this template
 <xsl:template name="db2html.inline">
   <xsl:param name="node" select="."/>
   <xsl:param name="children" select="false()"/>
-  <xsl:param name="class" select="local-name($node)"/>
-  <xsl:param name="bold" select="false()"/>
-  <xsl:param name="italic" select="false()"/>
-  <xsl:param name="underline" select="false()"/>
-  <xsl:param name="mono" select="false()"/>
-  <xsl:param name="sans" select="false()"/>
+  <xsl:param name="class" select="''"/>
   <xsl:param name="lang" select="$node/@lang"/>
   <xsl:param name="dir" select="false()"/>
   <xsl:param name="ltr" select="false()"/>
 
   <!-- FIXME: do CSS classes, rather than inline styles -->
-  <span class="{$class}">
+  <span class="{$class} {local-name($node)}">
     <xsl:choose>
       <xsl:when test="$dir = 'ltr' or $dir = 'rtl'">
         <xsl:attribute name="dir">
@@ -81,30 +71,6 @@ REMARK: Document this template
         </xsl:attribute>
       </xsl:when>
     </xsl:choose>
-    <xsl:if test="$bold or $italic or $mono or $underline or $sans">
-      <xsl:variable name="style">
-        <xsl:if test="$bold">
-          <xsl:text>font-weight: bold; </xsl:text>
-        </xsl:if>
-        <xsl:if test="$italic">
-          <xsl:text>font-style: italic; </xsl:text>
-        </xsl:if>
-        <xsl:if test="$underline">
-          <xsl:text>text-decoration: underline; </xsl:text>
-        </xsl:if>
-        <xsl:choose>
-          <xsl:when test="$mono">
-            <xsl:text>font-family: monospace; </xsl:text>
-          </xsl:when>
-          <xsl:when test="$sans">
-            <xsl:text>font-family: sans-serif; </xsl:text>
-          </xsl:when>
-        </xsl:choose>
-      </xsl:variable>
-      <xsl:attribute name="style">
-        <xsl:value-of select="$style"/>
-      </xsl:attribute>
-    </xsl:if>
     <xsl:call-template name="db2html.anchor">
       <xsl:with-param name="node" select="$node"/>
     </xsl:call-template>
@@ -160,7 +126,9 @@ FIXME
 
 <!-- = application = -->
 <xsl:template match="application">
-  <xsl:call-template name="db2html.inline"/>
+  <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'app'"/>
+  </xsl:call-template>
 </xsl:template>
 
 <!-- = authorinitials = -->
@@ -272,6 +240,7 @@ FIXME
 <!-- = classname = -->
 <xsl:template match="classname">
   <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'code'"/>
     <xsl:with-param name="ltr" select="true()"/>
   </xsl:call-template>
 </xsl:template>
@@ -286,6 +255,7 @@ FIXME
 <!-- = command = -->
 <xsl:template match="command">
   <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'cmd'"/>
     <xsl:with-param name="ltr" select="true()"/>
   </xsl:call-template>
 </xsl:template>
@@ -293,6 +263,7 @@ FIXME
 <!-- = computeroutput = -->
 <xsl:template match="computeroutput">
   <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'output'"/>
     <xsl:with-param name="ltr" select="true()"/>
   </xsl:call-template>
 </xsl:template>
@@ -300,6 +271,7 @@ FIXME
 <!-- = constant = -->
 <xsl:template match="constant">
   <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'code'"/>
     <xsl:with-param name="ltr" select="true()"/>
   </xsl:call-template>
 </xsl:template>
@@ -411,6 +383,7 @@ FIXME
 <!-- = exceptionname = -->
 <xsl:template match="exceptionname">
   <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'code'"/>
     <xsl:with-param name="ltr" select="true()"/>
   </xsl:call-template>
 </xsl:template>
@@ -508,32 +481,44 @@ FIXME
 
 <!-- = guibutton = -->
 <xsl:template match="guibutton">
-  <xsl:call-template name="db2html.inline"/>
+  <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'gui'"/>
+  </xsl:call-template>
 </xsl:template>
 
 <!-- = guiicon = -->
 <xsl:template match="guiicon">
-  <xsl:call-template name="db2html.inline"/>
+  <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'gui'"/>
+  </xsl:call-template>
 </xsl:template>
 
 <!-- = guilabel = -->
 <xsl:template match="guilabel">
-  <xsl:call-template name="db2html.inline"/>
+  <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'gui'"/>
+  </xsl:call-template>
 </xsl:template>
 
 <!-- = guimenu = -->
 <xsl:template match="guimenu">
-  <xsl:call-template name="db2html.inline"/>
+  <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'gui'"/>
+  </xsl:call-template>
 </xsl:template>
 
 <!-- = guimenuitem = -->
 <xsl:template match="guimenuitem">
-  <xsl:call-template name="db2html.inline"/>
+  <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'gui'"/>
+  </xsl:call-template>
 </xsl:template>
 
 <!-- = guisubmenu = -->
 <xsl:template match="guisubmenu">
-  <xsl:call-template name="db2html.inline"/>
+  <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'gui'"/>
+  </xsl:call-template>
 </xsl:template>
 
 <!-- = hardware = -->
@@ -558,12 +543,15 @@ FIXME
 
 <!-- = interface = -->
 <xsl:template match="interface">
-  <xsl:call-template name="db2html.inline"/>
+  <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'gui'"/>
+  </xsl:call-template>
 </xsl:template>
 
 <!-- = interfacename = -->
 <xsl:template match="interfacename">
   <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'code'"/>
     <xsl:with-param name="ltr" select="true()"/>
   </xsl:call-template>
 </xsl:template>
@@ -653,6 +641,7 @@ FIXME
 <!-- = markup = -->
 <xsl:template match="markup">
   <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'code'"/>
     <xsl:with-param name="ltr" select="true()"/>
   </xsl:call-template>
 </xsl:template>
@@ -669,7 +658,9 @@ FIXME
 
 <!-- = menuchoice = -->
 <xsl:template match="menuchoice">
-  <xsl:call-template name="db2html.inline"/>
+  <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'guiseq'"/>
+  </xsl:call-template>
 </xsl:template>
 
 <!-- = menuchoice % db2html.inline.content.mode = -->
@@ -704,6 +695,7 @@ FIXME
 <!-- = methodname = -->
 <xsl:template match="methodname">
   <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'code'"/>
     <xsl:with-param name="ltr" select="true()"/>
   </xsl:call-template>
 </xsl:template>
@@ -716,6 +708,7 @@ FIXME
 <!-- = option = -->
 <xsl:template match="option">
   <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'cmd'"/>
     <xsl:with-param name="ltr" select="true()"/>
   </xsl:call-template>
 </xsl:template>
@@ -755,6 +748,16 @@ FIXME
 <!-- = parameter = -->
 <xsl:template match="parameter">
   <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class">
+      <xsl:choose>
+        <xsl:when test="@class = 'function'">
+          <xsl:text>code</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>cmd</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:with-param>
     <xsl:with-param name="ltr" select="true()"/>
   </xsl:call-template>
 </xsl:template>
@@ -911,12 +914,15 @@ FIXME
 
 <!-- = replaceable = -->
 <xsl:template match="replaceable">
-  <xsl:call-template name="db2html.inline"/>
+  <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'var'"/>
+  </xsl:call-template>
 </xsl:template>
 
 <!-- = returnvalue = -->
 <xsl:template match="returnvalue">
   <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'code'"/>
     <xsl:with-param name="ltr" select="true()"/>
   </xsl:call-template>
 </xsl:template>
@@ -1032,6 +1038,7 @@ FIXME
 <!-- = structfield = -->
 <xsl:template match="structfield">
   <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'code'"/>
     <xsl:with-param name="ltr" select="true()"/>
   </xsl:call-template>
 </xsl:template>
@@ -1039,6 +1046,7 @@ FIXME
 <!-- = structname = -->
 <xsl:template match="structname">
   <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'code'"/>
     <xsl:with-param name="ltr" select="true()"/>
   </xsl:call-template>
 </xsl:template>
@@ -1074,6 +1082,7 @@ FIXME
 <!-- = systemitem = -->
 <xsl:template match="systemitem">
   <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'sys'"/>
     <xsl:with-param name="ltr" select="true()"/>
   </xsl:call-template>
 </xsl:template>
@@ -1104,6 +1113,7 @@ FIXME
 <!-- = type = -->
 <xsl:template match="type">
   <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'code'"/>
     <xsl:with-param name="ltr" select="true()"/>
   </xsl:call-template>
 </xsl:template>
@@ -1111,6 +1121,7 @@ FIXME
 <!-- = uri = -->
 <xsl:template match="uri">
   <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'sys'"/>
     <xsl:with-param name="ltr" select="true()"/>
   </xsl:call-template>
 </xsl:template>
@@ -1118,6 +1129,7 @@ FIXME
 <!-- = userinput = -->
 <xsl:template match="userinput">
   <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'input'"/>
     <xsl:with-param name="ltr" select="true()"/>
   </xsl:call-template>
 </xsl:template>
@@ -1125,6 +1137,7 @@ FIXME
 <!-- = varname = -->
 <xsl:template match="varname">
   <xsl:call-template name="db2html.inline">
+    <xsl:with-param name="class" select="'code'"/>
     <xsl:with-param name="ltr" select="true()"/>
   </xsl:call-template>
 </xsl:template>
diff --git a/xslt/mallard/html/mal2html-css.xsl b/xslt/mallard/html/mal2html-css.xsl
index 7a90293..550c1b7 100644
--- a/xslt/mallard/html/mal2html-css.xsl
+++ b/xslt/mallard/html/mal2html-css.xsl
@@ -206,20 +206,9 @@ li.tree div { margin: 0; padding: 0; }
 ul.tree ul.tree { margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.44em; }
 div.tree-lines ul.tree { margin-left: 0; }
 
-span.app { font-style: italic; }
-span.cmd {
-  font-family: monospace;
-  background-color: </xsl:text>
-    <xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
-  padding: 0 0.2em 0 0.2em;
-}
-span.code { font-family: monospace; }
 span.em { font-style: italic; }
 span.email { color: red; }
 span.file { font-family: monospace; }
-span.gui, span.guiseq { color: </xsl:text>
-  <xsl:value-of select="$theme.color.text_light"/><xsl:text>; }
-span.input { font-family: monospace; }
 span.hi {
   background-color: </xsl:text>
     <xsl:value-of select="$theme.color.yellow_background"/><xsl:text>;
@@ -235,9 +224,6 @@ span.keyseq {
   color: </xsl:text>
     <xsl:value-of select="$theme.color.text_light"/><xsl:text>;
 }
-span.output { font-family: monospace; }
-span.sys { font-family: monospace; }
-span.var { font-style: italic; }
 </xsl:text>
 <xsl:call-template name="mal2html.css.editor"/>
 <xsl:call-template name="mal2html.css.custom"/>
diff --git a/xslt/theme/theme-html.xsl b/xslt/theme/theme-html.xsl
index b92b646..e02d464 100644
--- a/xslt/theme/theme-html.xsl
+++ b/xslt/theme/theme-html.xsl
@@ -363,6 +363,28 @@ tr.shade td.shade {
   background-color: </xsl:text><xsl:value-of select="$theme.color.dark_background"/><xsl:text>;
 }
 
+span.app { font-style: italic; }
+span.cmd {
+  font-family: monospace;
+  background-color: </xsl:text>
+    <xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
+  padding: 0 0.2em 0 0.2em;
+}
+span.cmd span.cmd { background-color: none; padding: 0; }
+pre span.cmd { background-color: none; padding: 0; }
+span.code {
+  font-family: monospace;
+  border: solid 1px </xsl:text><xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
+  padding: 0 0.2em 0 0.2em;
+}
+span.code span.code { border: none; padding: 0; }
+pre span.code { border: none; padding: 0; }
+span.gui, span.guiseq { color: </xsl:text>
+  <xsl:value-of select="$theme.color.text_light"/><xsl:text>; }
+span.input { font-family: monospace; }
+span.output { font-family: monospace; }
+span.sys { font-family: monospace; }
+span.var { font-style: italic; }
 
 /* FIXME */
 div.screen .prompt {



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