[yelp-xsl] [theme-html.xsl] Merging common inline styles
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp-xsl] [theme-html.xsl] Merging common inline styles
- Date: Tue, 2 Mar 2010 23:47:24 +0000 (UTC)
commit a8761c4afe257938f6c5a6a71843658abe99f1d3
Author: Shaun McCance <shaunm gnome org>
Date: Tue Mar 2 17:46:59 2010 -0600
[theme-html.xsl] Merging common inline styles
test/testdocs/inline.x001.xml | 6 +++-
xslt/docbook/html/db2html-block.xsl | 3 --
xslt/docbook/html/db2html-css.xsl | 43 ++-------------------------
xslt/docbook/html/db2html-inline.xsl | 39 ++++++++++++++++++++-----
xslt/docbook/html/db2html-table.xsl | 2 +-
xslt/mallard/html/mal2html-css.xsl | 14 ---------
xslt/mallard/html/mal2html-inline.xsl | 28 ++++++------------
xslt/theme/theme-html.xsl | 51 ++++++++++++++++++++-------------
8 files changed, 80 insertions(+), 106 deletions(-)
---
diff --git a/test/testdocs/inline.x001.xml b/test/testdocs/inline.x001.xml
index 7fbee97..275c932 100644
--- a/test/testdocs/inline.x001.xml
+++ b/test/testdocs/inline.x001.xml
@@ -26,7 +26,11 @@
<para><corpauthor>corpauthor</corpauthor></para>
<para><database>database</database></para>
<para><email>email</email></para>
-<para><emphasis>emphasis</emphasis></para>
+<para>
+ <emphasis>emphasis</emphasis>
+ <emphasis role="bold">bold</emphasis>
+ <emphasis role="strong">strong</emphasis>
+</para>
<para><envar>envar</envar></para>
<para><errorcode>errorcode</errorcode></para>
<para><errorname>errorname</errorname></para>
diff --git a/xslt/docbook/html/db2html-block.xsl b/xslt/docbook/html/db2html-block.xsl
index d374508..79edd20 100644
--- a/xslt/docbook/html/db2html-block.xsl
+++ b/xslt/docbook/html/db2html-block.xsl
@@ -65,9 +65,6 @@ is then used by the CSS for styling.
<div>
<xsl:attribute name="class">
<xsl:value-of select="concat($class, ' ', local-name($node))"/>
- <xsl:if test="$verbatim">
- <xsl:text> block-verbatim</xsl:text>
- </xsl:if>
</xsl:attribute>
<xsl:choose>
<xsl:when test="$dir = 'ltr' or $dir = 'rtl'">
diff --git a/xslt/docbook/html/db2html-css.xsl b/xslt/docbook/html/db2html-css.xsl
index 3b993a2..36708e8 100644
--- a/xslt/docbook/html/db2html-css.xsl
+++ b/xslt/docbook/html/db2html-css.xsl
@@ -110,25 +110,7 @@ td.td-rowsep { border-bottom: solid 1px; }
thead { border-top: solid 2px; border-bottom: solid 2px; }
tfoot { border-top: solid 2px; border-bottom: solid 2px; }
-/*
-.block { margin-top: 1em; }
-.block .block-first { margin-top: 0; }
-*/
-.block-indent {
- margin-</xsl:text><xsl:value-of select="$left"/><xsl:text> left: 1.72em;
- margin-</xsl:text><xsl:value-of select="right"/><xsl:text>: 1em;
-}
-.block-indent .block-indent { margin-left: 0em; margin-right: 0em; }
-td .block-indent { margin-left: 0em; margin-right: 0em; }
-dd .block-indent { margin-left: 0em; margin-right: 0em; }
-.block-verbatim { white-space: pre; }
-div.title {
- margin-bottom: 0.2em;
- font-weight: bold;
- color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
-}
-div.title-formal { padding-left: 0.2em; padding-right: 0.2em; }
-div.title-formal .label { font-weight: normal; }
+div.title span.label { font-weight: normal; }
<!-- == linktrail == -->
ul.linktrail {
@@ -244,25 +226,17 @@ div.simplelist td {
border-</xsl:text><xsl:value-of select="$left"/><xsl:text>: solid 1px </xsl:text>
<xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
}
-/*
+<!--
div.simplelist td.td-first {
padding-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 0;
border-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 0;
}
-*/
+-->
span.accel { text-decoration: underline; }
-<!-- FIXME: stderr red text -->
-span.database { font-family: monospace; }
span.email { font-family: monospace; }
-span.emphasis { font-style: italic; }
-span.emphasis-bold { font-style: normal; font-weight: bold; }
-span.envar { font-family: monospace; }
-<!-- FIXME: error* red text -->
-span.filename { font-family: monospace; }
span.firstterm { font-style: italic; }
span.foreignphrase { font-style: italic; }
-span.function { font-family: monospace; }
dt.glossterm span.glossterm { font-style: normal; }
<!--
@@ -273,22 +247,11 @@ dd.glossdef, dd.glosssee, dd.glossseealso { margin-top: 0em; margin-bottom: 0;
span.glossterm { font-style: italic; }
-span.keycap {
- font-weight: bold;
- color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
-}
span.lineannotation { font-style: italic; }
-span.literal { font-family: monospace; }
span.medialabel { font-style: italic; }
-span.ooclass, span.ooexception, span.oointerface { font-family: monospace; }
-span.option { font-family: monospace; }
.methodparam span.parameter { font-style: italic; }
span.paramdef span.parameter { font-style: italic; }
span.prompt { font-family: monospace; }
-span.property { font-family: monospace; }
-span.sgmltag { font-family: monospace; }
-span.symbol { font-family: monospace; }
-span.token { font-family: monospace; }
span.wordasword { font-style: italic; }
<!-- FIXME below -->
diff --git a/xslt/docbook/html/db2html-inline.xsl b/xslt/docbook/html/db2html-inline.xsl
index e81ea37..f65b1c1 100644
--- a/xslt/docbook/html/db2html-inline.xsl
+++ b/xslt/docbook/html/db2html-inline.xsl
@@ -294,6 +294,7 @@ FIXME
<!-- = database = -->
<xsl:template match="database">
<xsl:call-template name="db2html.inline">
+ <xsl:with-param name="class" select="'sys'"/>
<xsl:with-param name="ltr" select="true()"/>
</xsl:call-template>
</xsl:template>
@@ -341,9 +342,9 @@ FIXME
<xsl:variable name="bold" select="@role = 'bold' or @role = 'strong'"/>
<xsl:call-template name="db2html.inline">
<xsl:with-param name="class">
- <xsl:text>emphasis</xsl:text>
+ <xsl:text>em</xsl:text>
<xsl:if test="$bold">
- <xsl:text> emphasis-bold</xsl:text>
+ <xsl:text> em-bold</xsl:text>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
@@ -352,6 +353,7 @@ FIXME
<!-- = envar = -->
<xsl:template match="envar">
<xsl:call-template name="db2html.inline">
+ <xsl:with-param name="class" select="'sys'"/>
<xsl:with-param name="ltr" select="true()"/>
</xsl:call-template>
</xsl:template>
@@ -359,6 +361,7 @@ FIXME
<!-- = errorcode = -->
<xsl:template match="errorcode">
<xsl:call-template name="db2html.inline">
+ <xsl:with-param name="class" select="'error'"/>
<xsl:with-param name="ltr" select="true()"/>
</xsl:call-template>
</xsl:template>
@@ -366,18 +369,23 @@ FIXME
<!-- = errorname = -->
<xsl:template match="errorname">
<xsl:call-template name="db2html.inline">
+ <xsl:with-param name="class" select="'error'"/>
<xsl:with-param name="ltr" select="true()"/>
</xsl:call-template>
</xsl:template>
<!-- = errortext = -->
<xsl:template match="errortext">
- <xsl:call-template name="db2html.inline"/>
+ <xsl:call-template name="db2html.inline">
+ <xsl:with-param name="class" select="'error'"/>
+ </xsl:call-template>
</xsl:template>
<!-- = errortype = -->
<xsl:template match="errortype">
- <xsl:call-template name="db2html.inline"/>
+ <xsl:call-template name="db2html.inline">
+ <xsl:with-param name="class" select="'error'"/>
+ </xsl:call-template>
</xsl:template>
<!-- = exceptionname = -->
@@ -396,6 +404,7 @@ FIXME
<!-- = filename = -->
<xsl:template match="filename">
<xsl:call-template name="db2html.inline">
+ <xsl:with-param name="class" select="'file'"/>
<xsl:with-param name="ltr" select="true()"/>
</xsl:call-template>
</xsl:template>
@@ -434,7 +443,9 @@ FIXME
<!-- = function = -->
<xsl:template match="function">
- <xsl:call-template name="db2html.inline"/>
+ <xsl:call-template name="db2html.inline">
+ <xsl:with-param name="class" select="'code'"/>
+ </xsl:call-template>
</xsl:template>
<!-- = glosskey = -->
@@ -578,7 +589,9 @@ FIXME
<!-- = keycap = -->
<xsl:template match="keycap">
- <xsl:call-template name="db2html.inline"/>
+ <xsl:call-template name="db2html.inline">
+ <xsl:with-param name="class" select="'key'"/>
+ </xsl:call-template>
</xsl:template>
<!-- = keycode = -->
@@ -590,7 +603,9 @@ FIXME
<!-- = keycombo = -->
<xsl:template match="keycombo">
- <xsl:call-template name="db2html.inline"/>
+ <xsl:call-template name="db2html.inline">
+ <xsl:with-param name="class" select="'keyseq'"/>
+ </xsl:call-template>
</xsl:template>
<!-- = keycombo % db2html.inline.content.mode = -->
@@ -634,6 +649,7 @@ FIXME
<!-- = literal = -->
<xsl:template match="literal">
<xsl:call-template name="db2html.inline">
+ <xsl:with-param name="class" select="'code'"/>
<xsl:with-param name="ltr" select="true()"/>
</xsl:call-template>
</xsl:template>
@@ -816,6 +832,7 @@ FIXME
<!-- = prompt = -->
<xsl:template match="prompt">
<xsl:call-template name="db2html.inline">
+ <xsl:with-param name="class" select="'output'"/>
<xsl:with-param name="ltr" select="true()"/>
</xsl:call-template>
</xsl:template>
@@ -823,6 +840,7 @@ FIXME
<!-- = property = -->
<xsl:template match="property">
<xsl:call-template name="db2html.inline">
+ <xsl:with-param name="class" select="'sys'"/>
<xsl:with-param name="ltr" select="true()"/>
</xsl:call-template>
</xsl:template>
@@ -840,6 +858,7 @@ FIXME
<!-- = ooclass = -->
<xsl:template match="ooclass">
<xsl:call-template name="db2html.inline">
+ <xsl:with-param name="class" select="'code'"/>
<xsl:with-param name="ltr" select="true()"/>
</xsl:call-template>
</xsl:template>
@@ -857,6 +876,7 @@ FIXME
<!-- = ooexception = -->
<xsl:template match="ooexception">
<xsl:call-template name="db2html.inline">
+ <xsl:with-param name="class" select="'code'"/>
<xsl:with-param name="ltr" select="true()"/>
</xsl:call-template>
</xsl:template>
@@ -874,6 +894,7 @@ FIXME
<!-- = oointerface = -->
<xsl:template match="oointerface">
<xsl:call-template name="db2html.inline">
+ <xsl:with-param name="class" select="'code'"/>
<xsl:with-param name="ltr" select="true()"/>
</xsl:call-template>
</xsl:template>
@@ -931,7 +952,7 @@ FIXME
<xsl:template match="sgmltag">
<xsl:call-template name="db2html.inline">
<xsl:with-param name="class">
- <xsl:text>sgmltag</xsl:text>
+ <xsl:text>code sgmltag</xsl:text>
<xsl:if test="@class">
<xsl:value-of select="concat(' sgmltag-', @class)"/>
</xsl:if>
@@ -1075,6 +1096,7 @@ FIXME
<!-- = symbol = -->
<xsl:template match="symbol">
<xsl:call-template name="db2html.inline">
+ <xsl:with-param name="class" select="'code'"/>
<xsl:with-param name="ltr" select="true()"/>
</xsl:call-template>
</xsl:template>
@@ -1090,6 +1112,7 @@ FIXME
<!-- = token = -->
<xsl:template match="token">
<xsl:call-template name="db2html.inline">
+ <xsl:with-param name="class" select="'code'"/>
<xsl:with-param name="ltr" select="true()"/>
</xsl:call-template>
</xsl:template>
diff --git a/xslt/docbook/html/db2html-table.xsl b/xslt/docbook/html/db2html-table.xsl
index 0daa2a3..b80d3a4 100644
--- a/xslt/docbook/html/db2html-table.xsl
+++ b/xslt/docbook/html/db2html-table.xsl
@@ -994,7 +994,7 @@ REMARK: This template needs to be explained in detail, but I forgot how it works
<!-- = table = -->
<xsl:template match="table | informaltable">
- <div class="table block block-indent">
+ <div class="table">
<xsl:if test="@lang">
<xsl:attribute name="dir">
<xsl:call-template name="l10n.direction">
diff --git a/xslt/mallard/html/mal2html-css.xsl b/xslt/mallard/html/mal2html-css.xsl
index 550c1b7..14d9ca8 100644
--- a/xslt/mallard/html/mal2html-css.xsl
+++ b/xslt/mallard/html/mal2html-css.xsl
@@ -206,24 +206,10 @@ li.tree div { margin: 0; padding: 0; }
ul.tree ul.tree { margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.44em; }
div.tree-lines ul.tree { margin-left: 0; }
-span.em { font-style: italic; }
-span.email { color: red; }
-span.file { font-family: monospace; }
span.hi {
background-color: </xsl:text>
<xsl:value-of select="$theme.color.yellow_background"/><xsl:text>;
}
-span.key {
- color: </xsl:text>
- <xsl:value-of select="$theme.color.text_light"/><xsl:text>;
- border: solid 1px </xsl:text>
- <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
- padding: 0 0.2em 0 0.2em;
-}
-span.keyseq {
- color: </xsl:text>
- <xsl:value-of select="$theme.color.text_light"/><xsl:text>;
-}
</xsl:text>
<xsl:call-template name="mal2html.css.editor"/>
<xsl:call-template name="mal2html.css.custom"/>
diff --git a/xslt/mallard/html/mal2html-inline.xsl b/xslt/mallard/html/mal2html-inline.xsl
index ad69ed2..33a472b 100644
--- a/xslt/mallard/html/mal2html-inline.xsl
+++ b/xslt/mallard/html/mal2html-inline.xsl
@@ -112,12 +112,13 @@ REMARK: Document this template
<!-- = em = -->
<xsl:template mode="mal2html.inline.mode" match="mal:em">
- <xsl:call-template name="mal2html.span"/>
-</xsl:template>
-
-<!-- = email = -->
-<xsl:template mode="mal2html.inline.mode" match="mal:email">
- <xsl:call-template name="mal2html.span"/>
+ <xsl:call-template name="mal2html.span">
+ <xsl:with-param name="class">
+ <xsl:if test="contains(concat(' ', @style, ' '), ' strong ')">
+ <xsl:text>em-bold</xsl:text>
+ </xsl:if>
+ </xsl:with-param>
+ </xsl:call-template>
</xsl:template>
<!-- = file = -->
@@ -231,28 +232,17 @@ REMARK: Document this template
<xsl:call-template name="mal2html.span">
<xsl:with-param name="class">
<xsl:choose>
- <xsl:when test="contains($style, ' output ')">
- <xsl:text>output-output</xsl:text>
- </xsl:when>
<xsl:when test="contains($style, ' error ')">
- <xsl:text>output-error</xsl:text>
+ <xsl:text>error</xsl:text>
</xsl:when>
<xsl:when test="contains($style, ' prompt ')">
- <xsl:text>output-prompt</xsl:text>
+ <xsl:text>prompt</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
-<!-- = quote = -->
-<xsl:template mode="mal2html.inline.mode" match="mal:quote">
- <!-- FIXME: do smart quoting -->
- <xsl:text>"</xsl:text>
- <xsl:call-template name="mal2html.span"/>
- <xsl:text>"</xsl:text>
-</xsl:template>
-
<!-- = span = -->
<xsl:template mode="mal2html.inline.mode" match="mal:span">
<xsl:call-template name="mal2html.span"/>
diff --git a/xslt/theme/theme-html.xsl b/xslt/theme/theme-html.xsl
index e02d464..67d5e2b 100644
--- a/xslt/theme/theme-html.xsl
+++ b/xslt/theme/theme-html.xsl
@@ -130,6 +130,7 @@ h2 { font-size: 1.2em; }
h3.title, h4.title, h5.title, h6.title, h7.title { font-size: 1.2em; }
h3, h4, h5, h6, h7 { font-size: 1em; }
+p { line-height: 1.72em; }
div, pre, p { margin: 1em 0 0 0; padding: 0; }
div:first-child, pre:first-child, p:first-child { margin-top: 0; }
div.inner, div.contents, pre.contents { margin-top: 0; }
@@ -198,8 +199,7 @@ a img { border: none; }
div.title {
margin: 0 0 0.2em 0;
font-weight: bold;
- color: </xsl:text>
- <xsl:value-of select="$theme.color.text_light"/><xsl:text>;
+ color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
}
div.desc { margin: 0 0 0.2em 0; }
div.contents + div.desc { margin: 0.2em 0 0 0; }
@@ -374,35 +374,46 @@ span.cmd span.cmd { background-color: none; padding: 0; }
pre span.cmd { background-color: none; padding: 0; }
span.code {
font-family: monospace;
- border: solid 1px </xsl:text><xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
- padding: 0 0.2em 0 0.2em;
+ border-bottom: solid 1px </xsl:text><xsl:value-of select="$theme.color.dark_background"/><xsl:text>;
+}
+span.code span.code { border: none; }
+pre span.code { border: none; }
+span.em { font-style: italic; }
+span.em-bold {
+ font-style: normal; font-weight: bold;
+ color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
}
-span.code span.code { border: none; padding: 0; }
-pre span.code { border: none; padding: 0; }
+pre span.error {
+ color: </xsl:text><xsl:value-of select="$theme.color.text_error"/><xsl:text>;
+}
+span.file { font-family: monospace; }
span.gui, span.guiseq { color: </xsl:text>
<xsl:value-of select="$theme.color.text_light"/><xsl:text>; }
span.input { font-family: monospace; }
-span.output { font-family: monospace; }
-span.sys { font-family: monospace; }
-span.var { font-style: italic; }
-
-/* FIXME */
-div.screen .prompt {
- color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
-}
-div.screen .userinput {
+pre span.input {
font-weight: bold;
color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
}
-pre.screen span.output {
+span.key {
color: </xsl:text>
<xsl:value-of select="$theme.color.text_light"/><xsl:text>;
+ border: solid 1px </xsl:text>
+ <xsl:value-of select="$theme.color.yellow_border"/><xsl:text>;
+ padding: 0 0.2em 0 0.2em;
}
-pre.screen span.output-error {
-<!-- FIXME: theme -->
- color: #ff0000;
+span.keyseq {
+ color: </xsl:text>
+ <xsl:value-of select="$theme.color.text_light"/><xsl:text>;
}
-pre.screen span.output-prompt { font-weight: bold; }
+span.output { font-family: monospace; }
+pre span.output {
+ color: </xsl:text><xsl:value-of select="$theme.color.text"/><xsl:text>;
+}
+pre span.prompt {
+ color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
+}
+span.sys { font-family: monospace; }
+span.var { font-style: italic; }
</xsl:text>
</xsl:template>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]