[yelp-xsl] dita2html-inline: Added dita2html.span



commit ad4702890639234b6ec93b4c270f83676ffc00bb
Author: Shaun McCance <shaunm gnome org>
Date:   Tue Oct 2 15:23:03 2012 -0400

    dita2html-inline: Added dita2html.span

 xslt/dita/html/dita2html-inline.xsl |   95 ++++++++++++++++++++++++----------
 xslt/dita/html/dita2html-topic.xsl  |    6 ++
 xslt/dita/html/selectors.mod        |    8 +++
 3 files changed, 81 insertions(+), 28 deletions(-)
---
diff --git a/xslt/dita/html/dita2html-inline.xsl b/xslt/dita/html/dita2html-inline.xsl
index 6a28840..3ccbd4d 100644
--- a/xslt/dita/html/dita2html-inline.xsl
+++ b/xslt/dita/html/dita2html-inline.xsl
@@ -30,63 +30,102 @@ DITA to HTML - Inlines
 REMARK: Describe this module
 -->
 
+<!--**==========================================================================
+dita2html.span
+Output an HTML #{span} element.
+:Revision:version="1.0" date="2010-06-03" status="final"
+$node: The source element to output a #{span} for.
+$class: The value of the HTML #{class} attribute.
+
+FIXME
+-->
+<xsl:template name="dita2html.span">
+  <xsl:param name="node" select="."/>
+  <xsl:param name="class" select="local-name($node)"/>
+  <span class="{$class}">
+    <xsl:call-template name="html.lang.attrs">
+      <xsl:with-param name="node" select="$node"/>
+    </xsl:call-template>
+    <xsl:apply-templates mode="dita2html.inline.content.mode" select="$node"/>
+  </span>
+</xsl:template>
+
+<xsl:template mode="dita2html.inline.content.mode" match="*">
+  <xsl:apply-templates mode="dita2html.topic.mode"/>
+</xsl:template>
+
 
 <!-- == Matched Templates == -->
 
+<!-- = b = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_b;">
+  <xsl:call-template name="dita2html.span"/>
+</xsl:template>
+
 <!-- = codeph = -->
 <xsl:template mode="dita2html.topic.mode" match="&topic_codeph;">
-  <span class="code">
-    <xsl:call-template name="html.lang.attrs"/>
-    <xsl:apply-templates mode="dita2html.topic.mode"/>
-  </span>
+  <xsl:call-template name="dita2html.span">
+    <xsl:with-param name="class" select="'code'"/>
+  </xsl:call-template>
 </xsl:template>
 
 <!-- = cmdname = -->
 <xsl:template mode="dita2html.topic.mode" match="&topic_cmdname;">
-  <span class="cmd">
-    <xsl:call-template name="html.lang.attrs"/>
-    <xsl:apply-templates mode="dita2html.topic.mode"/>
-  </span>
+  <xsl:call-template name="dita2html.span">
+    <xsl:with-param name="class" select="'cmd'"/>
+  </xsl:call-template>
 </xsl:template>
 
 <!-- = filepath = -->
 <xsl:template mode="dita2html.topic.mode" match="&topic_filepath;">
-  <span class="file">
-    <xsl:call-template name="html.lang.attrs"/>
-    <xsl:apply-templates mode="dita2html.topic.mode"/>
-  </span>
+  <xsl:call-template name="dita2html.span">
+    <xsl:with-param name="class" select="'file'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<!-- = i = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_i;">
+  <xsl:call-template name="dita2html.span"/>
 </xsl:template>
 
 <!-- = systemoutput = -->
 <xsl:template mode="dita2html.topic.mode" match="&topic_systemoutput;">
-  <span class="output">
-    <xsl:call-template name="html.lang.attrs"/>
-    <xsl:apply-templates mode="dita2html.topic.mode"/>
-  </span>
+  <xsl:call-template name="dita2html.span">
+    <xsl:with-param name="class" select="'output'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<!-- = tt = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_tt;">
+  <xsl:call-template name="dita2html.span">
+    <xsl:with-param name="class" select="'sys'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<!-- = u = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_u;">
+  <xsl:call-template name="dita2html.span"/>
 </xsl:template>
 
 <!-- = uicontrol = -->
 <xsl:template mode="dita2html.topic.mode" match="&topic_uicontrol;">
-  <span class="gui">
-    <xsl:call-template name="html.lang.attrs"/>
-    <xsl:apply-templates mode="dita2html.topic.mode"/>
-  </span>
+  <xsl:call-template name="dita2html.span">
+    <xsl:with-param name="class" select="'gui'"/>
+  </xsl:call-template>
 </xsl:template>
 
 <!-- = userinput = -->
 <xsl:template mode="dita2html.topic.mode" match="&topic_userinput;">
-  <span class="input">
-    <xsl:call-template name="html.lang.attrs"/>
-    <xsl:apply-templates mode="dita2html.topic.mode"/>
-  </span>
+  <xsl:call-template name="dita2html.span">
+    <xsl:with-param name="class" select="'input'"/>
+  </xsl:call-template>
 </xsl:template>
 
 <!-- = varname = -->
 <xsl:template mode="dita2html.topic.mode" match="&topic_varname;">
-  <span class="var">
-    <xsl:call-template name="html.lang.attrs"/>
-    <xsl:apply-templates mode="dita2html.topic.mode"/>
-  </span>
+  <xsl:call-template name="dita2html.span">
+    <xsl:with-param name="class" select="'var'"/>
+  </xsl:call-template>
 </xsl:template>
 
 </xsl:stylesheet>
diff --git a/xslt/dita/html/dita2html-topic.xsl b/xslt/dita/html/dita2html-topic.xsl
index ecede8f..a9f2382 100644
--- a/xslt/dita/html/dita2html-topic.xsl
+++ b/xslt/dita/html/dita2html-topic.xsl
@@ -81,6 +81,12 @@ REMARK: Describe this module
     </xsl:call-template>
   </xsl:param>
 <xsl:text>
+span.b {
+  font-weight: bold;
+  color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
+}
+span.i { font-style: italic; }
+span.u { text-decoration: underline; }
 li.stepsection {
   margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 0;
   list-style-type: none;
diff --git a/xslt/dita/html/selectors.mod b/xslt/dita/html/selectors.mod
index b1fd50c..908f66f 100644
--- a/xslt/dita/html/selectors.mod
+++ b/xslt/dita/html/selectors.mod
@@ -144,14 +144,22 @@ topic/p
 <!-- ===========================================================================
 topic/ph
 -->
+<!ENTITY topic_b "*[
+  name(.) = 'b' or starts-with(@class, '- topic/ph hi-d/b ')]">
 <!ENTITY topic_cmd "*[
   name(.) = 'cmd' or starts-with(@class, '- topic/ph task/cmd ')]">
 <!ENTITY topic_codeph "*[
   name(.) = 'codeph' or starts-with(@class, '- topic/ph pr-d/codeph ')]">
 <!ENTITY topic_filepath "*[
   name(.) = 'filepath' or starts-with(@class, '- topic/ph sw-d/filepath ')]">
+<!ENTITY topic_i "*[
+  name(.) = 'i' or starts-with(@class, '- topic/ph hi-d/i ')]">
 <!ENTITY topic_systemoutput "*[
   name(.) = 'systemoutput' or starts-with(@class, '- topic/ph sw-d/systemoutput ')]">
+<!ENTITY topic_tt "*[
+  name(.) = 'tt' or starts-with(@class, '- topic/ph hi-d/tt ')]">
+<!ENTITY topic_u "*[
+  name(.) = 'u' or starts-with(@class, '- topic/ph hi-d/u ')]">
 <!ENTITY topic_uicontrol "*[
   name(.) = 'uicontrol' or starts-with(@class, '- topic/ph ui-d/uicontrol ')]">
 <!ENTITY topic_userinput "*[



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