[yelp-xsl] Make example a formal element
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp-xsl] Make example a formal element
- Date: Sat, 12 Sep 2015 15:21:05 +0000 (UTC)
commit 2dcf168dde754d18152b008473269a803d6e650b
Author: Shaun McCance <shaunm gnome org>
Date: Sat Sep 12 11:20:39 2015 -0400
Make example a formal element
https://github.com/projectmallard/projectmallard.org/issues/4
xslt/common/html.xsl | 1 +
xslt/mallard/html/mal2html-block.xsl | 18 ++++++++++++++++--
2 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/xslt/common/html.xsl b/xslt/common/html.xsl
index a29a38b..b1db80b 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 5595692..6eb999c 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>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]