[yelp-xsl] dita2html-inline: Support conref, add a few elements
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp-xsl] dita2html-inline: Support conref, add a few elements
- Date: Thu, 4 Oct 2012 16:04:37 +0000 (UTC)
commit 9408b75fa8db775465ab584371ba0c96db88d534
Author: Shaun McCance <shaunm gnome org>
Date: Thu Oct 4 12:03:37 2012 -0400
dita2html-inline: Support conref, add a few elements
xslt/dita/common/dita-selectors.mod | 9 ++++++
xslt/dita/html/dita2html-inline.xsl | 50 ++++++++++++++++++++++++++++++++++-
2 files changed, 58 insertions(+), 1 deletions(-)
---
diff --git a/xslt/dita/common/dita-selectors.mod b/xslt/dita/common/dita-selectors.mod
index 908f66f..6671ec7 100644
--- a/xslt/dita/common/dita-selectors.mod
+++ b/xslt/dita/common/dita-selectors.mod
@@ -63,6 +63,8 @@ topic/keyword
name(.) = 'cmdname' or starts-with(@class, '- topic/keyword sw-d/cmdname ')]">
<!ENTITY topic_varname "*[
name(.) = 'varname' or starts-with(@class, '- topic/keyword sw-d/varname ')]">
+<!ENTITY topic_wintitle "*[
+ name(.) = 'wintitle' or starts-with(@class, '- topic/keyword sw-d/wintitle ')]">
<!-- ===========================================================================
topic/li
@@ -154,6 +156,8 @@ topic/ph
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_menucascade "*[
+ name(.) = 'menucascade' or starts-with(@class, '- topic/ph hi-d/menucascade ')]">
<!ENTITY topic_systemoutput "*[
name(.) = 'systemoutput' or starts-with(@class, '- topic/ph sw-d/systemoutput ')]">
<!ENTITY topic_tt "*[
@@ -212,6 +216,11 @@ topic/shortdesc
<!ENTITY topic_shortdesc "*[name(.) = 'shortdesc' or starts-with(@class, '- topic/shortdesc ')]">
<!-- ===========================================================================
+topic/text
+-->
+<!ENTITY topic_text "*[name(.) = 'text' or starts-with(@class, '- topic/text ')]">
+
+<!-- ===========================================================================
topic/title
-->
<!ENTITY topic_title "*[name(.) = 'title' or starts-with(@class, '- topic/title ')]">
diff --git a/xslt/dita/html/dita2html-inline.xsl b/xslt/dita/html/dita2html-inline.xsl
index 63426af..296b531 100644
--- a/xslt/dita/html/dita2html-inline.xsl
+++ b/xslt/dita/html/dita2html-inline.xsl
@@ -21,7 +21,9 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:yelp="http://projects.gnome.org/yelp/"
xmlns="http://www.w3.org/1999/xhtml"
+ exclude-result-prefixes="yelp"
version="1.0">
<!--!!==========================================================================
@@ -52,7 +54,8 @@ FIXME
</xsl:template>
<xsl:template mode="dita2html.inline.content.mode" match="*">
- <xsl:apply-templates mode="dita2html.topic.mode"/>
+ <xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
+ <xsl:apply-templates mode="dita2html.topic.mode" select="$conref/node()"/>
</xsl:template>
@@ -89,6 +92,39 @@ FIXME
<xsl:call-template name="dita2html.span"/>
</xsl:template>
+<!-- = menucascade = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_menucascade;">
+ <xsl:call-template name="dita2html.span">
+ <xsl:with-param name="class" select="'guiseq'"/>
+ </xsl:call-template>
+</xsl:template>
+
+<!-- = menucascade % dita2html.inline.content.mode = -->
+<xsl:template mode="dita2html.inline.content.mode" match="&topic_menucascade;">
+ <xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
+ <xsl:for-each select="$conref">
+ <xsl:variable name="arrow">
+ <xsl:variable name="dir">
+ <xsl:call-template name="l10n.direction"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$dir = 'rtl'">
+ <xsl:text> ◂ </xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text> ▸ </xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:for-each select="&topic_uicontrol;">
+ <xsl:if test="position() != 1">
+ <xsl:value-of select="$arrow"/>
+ </xsl:if>
+ <xsl:apply-templates mode="dita2html.topic.mode" select="."/>
+ </xsl:for-each>
+ </xsl:for-each>
+</xsl:template>
+
<!-- = systemoutput = -->
<xsl:template mode="dita2html.topic.mode" match="&topic_systemoutput;">
<xsl:call-template name="dita2html.span">
@@ -96,6 +132,11 @@ FIXME
</xsl:call-template>
</xsl:template>
+<!-- = text = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_text;">
+ <xsl:call-template name="dita2html.span"/>
+</xsl:template>
+
<!-- = tt = -->
<xsl:template mode="dita2html.topic.mode" match="&topic_tt;">
<xsl:call-template name="dita2html.span">
@@ -129,4 +170,11 @@ FIXME
</xsl:call-template>
</xsl:template>
+<!-- = wintitle = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_wintitle;">
+ <xsl:call-template name="dita2html.span">
+ <xsl:with-param name="class" select="'gui'"/>
+ </xsl:call-template>
+</xsl:template>
+
</xsl:stylesheet>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]