summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2015-09-12 11:20:39 -0400
committerShaun McCance <shaunm@gnome.org>2015-09-12 11:20:39 -0400
commit2dcf168dde754d18152b008473269a803d6e650b (patch)
treec927a2a20d188068b461d1e16f45ae27b3a94f6c
parentb203f52216b7ce2eba4b7130b9373a12951b01d1 (diff)
downloadyelp-xsl-2dcf168dde754d18152b008473269a803d6e650b.tar.gz
Make example a formal element
https://github.com/projectmallard/projectmallard.org/issues/4
-rw-r--r--xslt/common/html.xsl1
-rw-r--r--xslt/mallard/html/mal2html-block.xsl18
2 files changed, 17 insertions, 2 deletions
diff --git a/xslt/common/html.xsl b/xslt/common/html.xsl
index a29a38bb..b1db80bc 100644
--- a/xslt/common/html.xsl
+++ b/xslt/common/html.xsl
@@ -1084,6 +1084,7 @@ div.example {
<xsl:value-of select="$color.gray_border"/><xsl:text>;
padding-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1em;
}
+div.example > div.inner > div.region > div.desc { font-style: italic; }
div.figure {
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.72em;
padding: 4px;
diff --git a/xslt/mallard/html/mal2html-block.xsl b/xslt/mallard/html/mal2html-block.xsl
index 55956924..6eb999cd 100644
--- a/xslt/mallard/html/mal2html-block.xsl
+++ b/xslt/mallard/html/mal2html-block.xsl
@@ -251,17 +251,31 @@ in accordance with the Mallard specification on fallback block content.
<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 != ''">
<div>
+ <xsl:call-template name="html.lang.attrs"/>
<xsl:call-template name="html.class.attr">
<xsl:with-param name="class">
<xsl:text>example</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="html.lang.attrs"/>
- <xsl:apply-templates mode="mal2html.block.mode"/>
+ <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>