[yelp-xsl] Allow non-experimental hi element, now with style hints



commit 0a73411dae3559bdeb17410b6a0a8a5727752630
Author: Shaun McCance <shaunm redhat com>
Date:   Sun Oct 28 17:19:30 2018 -0400

    Allow non-experimental hi element, now with style hints

 xslt/mallard/html/mal2html-inline.xsl | 37 +++++++++++++++++++++++++++++++++++
 xslt/mallard/html/mal2html-page.xsl   | 23 ++++++++++++++++++++++
 2 files changed, 60 insertions(+)
---
diff --git a/xslt/mallard/html/mal2html-inline.xsl b/xslt/mallard/html/mal2html-inline.xsl
index 4048b261..a65f276b 100644
--- a/xslt/mallard/html/mal2html-inline.xsl
+++ b/xslt/mallard/html/mal2html-inline.xsl
@@ -216,6 +216,43 @@ an `xref` or `href` attribute.
   <xsl:call-template name="mal2html.span"/>
 </xsl:template>
 
+<xsl:template mode="mal2html.inline.mode" match="mal:hi">
+  <xsl:variable name="style" select="concat(' ', @style, ' ')"/>
+  <xsl:call-template name="mal2html.span">
+    <xsl:with-param name="class">
+      <xsl:choose>
+        <xsl:when test="contains($style, ' ins ')">
+          <xsl:text>hi-ins</xsl:text>
+        </xsl:when>
+        <xsl:when test="contains($style, ' del ')">
+          <xsl:text>hi-del</xsl:text>
+        </xsl:when>
+        <xsl:when test="contains($style, ' red ')">
+          <xsl:text>hi-red</xsl:text>
+        </xsl:when>
+        <xsl:when test="contains($style, ' orange ')">
+          <xsl:text>hi-orange</xsl:text>
+        </xsl:when>
+        <xsl:when test="contains($style, ' yellow ')">
+          <xsl:text>hi-yellow</xsl:text>
+        </xsl:when>
+        <xsl:when test="contains($style, ' green ')">
+          <xsl:text>hi-green</xsl:text>
+        </xsl:when>
+        <xsl:when test="contains($style, ' blue ')">
+          <xsl:text>hi-blue</xsl:text>
+        </xsl:when>
+        <xsl:when test="contains($style, ' purple ')">
+          <xsl:text>hi-purple</xsl:text>
+        </xsl:when>
+        <xsl:when test="contains($style, ' gray ')">
+          <xsl:text>hi-gray</xsl:text>
+        </xsl:when>
+      </xsl:choose>
+    </xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
 <!-- = key = -->
 <xsl:template mode="mal2html.inline.mode" match="mal:key">
   <xsl:call-template name="mal2html.span"/>
diff --git a/xslt/mallard/html/mal2html-page.xsl b/xslt/mallard/html/mal2html-page.xsl
index f673d1f3..c2a01e7e 100644
--- a/xslt/mallard/html/mal2html-page.xsl
+++ b/xslt/mallard/html/mal2html-page.xsl
@@ -1429,6 +1429,29 @@ span.hi {
   background-color: </xsl:text>
     <xsl:value-of select="$color.bg.yellow"/><xsl:text>;
 }
+span.hi.hi-ins {
+  background-color: </xsl:text>
+    <xsl:value-of select="$color.bg.green"/><xsl:text>;
+}
+span.hi.hi-del {
+  background-color: </xsl:text>
+    <xsl:value-of select="$color.bg.red"/><xsl:text>;
+  text-decoration: line-through;
+}
+span.hi.hi-red { background-color: </xsl:text>
+  <xsl:value-of select="$color.bg.red"/><xsl:text>; }
+span.hi.hi-orange { background-color: </xsl:text>
+  <xsl:value-of select="$color.bg.orange"/><xsl:text>; }
+span.hi.hi-yellow { background-color: </xsl:text>
+  <xsl:value-of select="$color.bg.yellow"/><xsl:text>; }
+span.hi.hi-green { background-color: </xsl:text>
+  <xsl:value-of select="$color.bg.green"/><xsl:text>; }
+span.hi.hi-blue { background-color: </xsl:text>
+  <xsl:value-of select="$color.bg.blue"/><xsl:text>; }
+span.hi.hi-purple { background-color: </xsl:text>
+  <xsl:value-of select="$color.bg.purple"/><xsl:text>; }
+span.hi.hi-gray { background-color: </xsl:text>
+  <xsl:value-of select="$color.bg.gray"/><xsl:text>; }
 
 <!-- experimental/gloss -->
 dt.gloss-term {


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