[yelp-xsl] mal2html-block: Add support for generic div element, MEP-0005



commit 62eb60da8de10f41a819d9f075feef5701a5a6d8
Author: Shaun McCance <shaunm gnome org>
Date:   Sat Feb 27 10:35:12 2016 -0500

    mal2html-block: Add support for generic div element, MEP-0005

 xslt/mallard/html/mal2html-block.xsl |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/xslt/mallard/html/mal2html-block.xsl b/xslt/mallard/html/mal2html-block.xsl
index 6eb999c..11d25d5 100644
--- a/xslt/mallard/html/mal2html-block.xsl
+++ b/xslt/mallard/html/mal2html-block.xsl
@@ -247,6 +247,39 @@ in accordance with the Mallard specification on fallback block content.
   <xsl:value-of select="$node/@date"/>
 </xsl:template>
 
+<!-- = div = -->
+<xsl:template mode="mal2html.block.mode" match="mal:div">
+  <xsl:variable name="if"><xsl:call-template name="mal.if.test"/></xsl:variable><xsl:if test="$if != ''">
+  <div>
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:call-template name="html.class.attr">
+      <xsl:with-param name="class">
+        <xsl:text>div</xsl:text>
+        <xsl:if test="mal:title and @ui:expanded">
+          <xsl:text> ui-expander</xsl:text>
+        </xsl:if>
+        <xsl:if test="$if != 'true'">
+          <xsl:text> if-if </xsl:text>
+          <xsl:value-of select="$if"/>
+        </xsl:if>
+      </xsl:with-param>
+    </xsl:call-template>
+    <xsl:call-template name="mal2html.ui.expander.data"/>
+    <div class="inner">
+      <xsl:apply-templates mode="mal2html.block.mode" select="mal:title[1]"/>
+      <div class="region">
+        <xsl:apply-templates mode="mal2html.block.mode" select="mal:desc[1]"/>
+        <div class="contents">
+          <xsl:for-each select="*[not(self::mal:title or self::mal:desc)]">
+            <xsl:apply-templates mode="mal2html.block.mode" select="."/>
+          </xsl:for-each>
+        </div>
+      </div>
+    </div>
+  </div>
+</xsl:if>
+</xsl:template>
+
 <!-- = example = -->
 <xsl:template mode="mal2html.block.mode" match="mal:example">
   <xsl:variable name="if"><xsl:call-template name="mal.if.test"/></xsl:variable><xsl:if test="$if != ''">


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