[yelp-xsl/tmpl: 5/6] Use text templates for DocBook CSS




commit c31954f842688bba4bc13932cd31e33c759e342e
Author: Shaun McCance <shaunm redhat com>
Date:   Sat Oct 17 10:24:27 2020 -0400

    Use text templates for DocBook CSS

 xslt/common/css/docbook.css.tmpl       | 175 ++++++++++++++++++++++++++
 xslt/docbook/html/Makefile.am          |   1 -
 xslt/docbook/html/db2html-css.xsl      | 224 ---------------------------------
 xslt/docbook/html/db2html-division.xsl |  25 +++-
 xslt/docbook/html/db2xhtml.xsl         |   1 -
 5 files changed, 199 insertions(+), 227 deletions(-)
---
diff --git a/xslt/common/css/docbook.css.tmpl b/xslt/common/css/docbook.css.tmpl
new file mode 100644
index 00000000..047492ad
--- /dev/null
+++ b/xslt/common/css/docbook.css.tmpl
@@ -0,0 +1,175 @@
+<tmpl>
+div.hgroup.bridgehead { margin-top: 1em; }
+
+<!-- == common == -->
+sub { font-size: 0.83em; }
+sub sub { font-size: 1em; }
+sup { font-size: 0.83em; }
+sup sup { font-size: 1em; }
+table.table-pgwide { width: 100%; }
+table.table-rules-groups thead + *, table.table-rules-rows thead + *,
+table.table-rules-groups tfoot + *, table.table-rules-rows tfoot + *,
+table.table-rules-groups tbody + *, table.table-rules-rows tbody + *,
+table.table-rules-rows tr + * { border-top: solid 1px; }
+table.table-rules-cols td + *, table.table-rules-cols th + * {
+  border-{{$left}}: solid 1px;
+}
+
+td.td-colsep { border-{{$right}}: solid 1px; }
+td.td-rowsep { border-bottom: solid 1px; }
+
+<!-- == bibliography == -->
+span.bibliolabel {
+  font-weight: bold;
+  color: {{$color.fg.dark}};
+}
+div.biblioentry span.title {
+  font-weight: normal;
+  font-style: italic;
+}
+span.citetitle {
+  font-style: italic;
+}
+
+<!-- == block == -->
+div.epigraph {
+  text-align: {{$right}};
+  margin-{{$left}}: 20%;
+  margin-{{$right}}: 0;
+  color: {{$color.fg.dark}};
+}
+div.programlisting .userinput {
+  font-weight: bold;
+  color: {{$color.fg.dark}};
+}
+div.address, div.literallayout { white-space: pre; }
+
+
+<!-- == footnotes == -->
+div.footnotes {
+  border-top: solid 2px {{$color.gray}};
+}
+div.footnote { margin-top: 1.44em; }
+sup.footnote { font-size: 0.83em; }
+a.footnote {
+  font-weight: bold;
+  text-decoration: none;
+  border-bottom: none;
+  padding: 0.2em 0.5em 0.2em 0.5em;
+  border-radius: 2px;
+}
+div.footnote > a.footnote {
+  margin-{{$right}}: 0.83em;
+  background-color: {{$color.bg.gray}};
+}
+div.footnote > a.footnote + p { display: inline-block; margin: 0; }
+a.footnote:hover, div.footnote > a.footnote:hover {
+  background-color: {{$color.bg.blue}};
+  box-shadow: 0 0 2px {{$color.blue}};
+}
+
+<!-- == indexes == -->
+dt.ixprimary {
+  font-weight: bold;
+  color: {{$color.fg.dark}};
+}
+dt.ixprimary * { font-style: normal; }
+dt.ixprimary + dt.ixprimary { margin-top: 1em; }
+dd.ixsecondary {
+  color: {{$color.fg.gray}};
+}
+dt.ixsecondary, dt.ixtertiary { margin-top: 0.2em; }
+dd.ixlink, dd.ixsee, dd.ixseealso {
+  color: {{$color.fg.gray}};
+}
+dd.ixlink + dd, dd.ixsee + dd, dd.ixseealso + dd {
+  margin-top: 0.2em;
+}
+dt.ixsecondary:before, dt.ixtertiary:before {
+  content: "⏺";
+  color: {{$color.fg.gray}};
+}
+dd.ixlink:before {
+  content: "⏺";
+  color: {{$color.blue}};
+}
+dd.ixsee:before, dd.ixseealso:before {
+  content: "⏺";
+  color: {{$color.gray}};
+}
+
+<!-- == unsorted == -->
+dl.index dt { margin-top: 0; }
+dl.index dd { margin-top: 0; margin-bottom: 0; }
+dl.indexdiv dt { margin-top: 0; }
+dl.indexdiv dd { margin-top: 0; margin-bottom: 0; }
+dl.setindex dt { margin-top: 0; }
+dl.setindex dd { margin-top: 0; margin-bottom: 0; }
+div.simplelist { margin-{{$left}}: 1.72em; }
+div.simplelist table { margin-left: 0; border: none; }
+div.simplelist td {
+  padding: 0.5em;
+  border-{{$left}}: solid 1px {{$color.gray}};
+}
+div.simplelist td:first-child {
+  padding-{{$left}}: 0;
+  border-{{$left}}: 0;
+}
+
+span.accel { text-decoration: underline; }
+span.email { font-family: monospace,monospace; font-size: 0.83em; }
+span.firstterm { font-style: italic; }
+span.foreignphrase { font-style: italic; }
+
+dt.glossterm span.glossterm { font-style: normal; }
+<!--
+dt.glossterm { margin-left: 0em; }
+dd + dt.glossterm { margin-top: 2em; }
+dd.glossdef, dd.glosssee, dd.glossseealso { margin-top: 0em;  margin-bottom: 0; }
+-->
+
+span.glossterm { font-style: italic; }
+
+span.lineannotation { font-style: italic; }
+span.medialabel { font-style: italic; }
+.methodparam span.parameter { font-style: italic; }
+span.paramdef span.parameter { font-style: italic; }
+span.prompt { font-family: monospace,monospace; font-size: 0.83em; }
+span.wordasword { font-style: italic; }
+<!-- FIXME below -->
+
+dt.question {
+  margin-left: 0;
+  margin-right: 0;
+  font-weight: bold;
+  color: {{$color.fg.dark}};
+}
+dd + dt.question { margin-top: 1em; }
+dd.answer {
+  margin-top: 1em;
+  margin-left: 2em;
+  margin-right: 2em;
+}
+div.qanda-label {
+  line-height: 1.44em;
+  float: {{$left}};
+  margin-{{$right}}: 1em;
+  font-weight: bold;
+  color: {{$color.fg.dark}};
+}
+dl.qandaset ol, dl.qandaset ul, dl.qandaset table { clear: both; }
+
+div.synopfragment { padding-top: 0.5em; }
+span.co {
+  border-radius: 4px;
+  background-color: {{$color.bg.yellow}};
+  outline: solid 1px {{$color.yellow}};
+}
+span.co a { text-decoration: none; }
+span.co a:hover { text-decoration: none; }
+div.co {
+  margin: 0;
+  float: {{$left}};
+  clear: both;
+}
+</tmpl>
diff --git a/xslt/docbook/html/Makefile.am b/xslt/docbook/html/Makefile.am
index a25394a8..8a3afa3b 100644
--- a/xslt/docbook/html/Makefile.am
+++ b/xslt/docbook/html/Makefile.am
@@ -6,7 +6,6 @@ xsl_DATA =                              \
        db2html-callout.xsl             \
        db2html-classsynopsis.xsl       \
        db2html-cmdsynopsis.xsl         \
-       db2html-css.xsl                 \
        db2html-division.xsl            \
        db2html-ebnf.xsl                \
        db2html-footnote.xsl            \
diff --git a/xslt/docbook/html/db2html-division.xsl b/xslt/docbook/html/db2html-division.xsl
index 1679d712..a40c32e2 100644
--- a/xslt/docbook/html/db2html-division.xsl
+++ b/xslt/docbook/html/db2html-division.xsl
@@ -58,7 +58,6 @@ common {html} stylesheet.
 
 <!--%# html.sidebar.contents.mode -->
 <xsl:template mode="html.sidebar.contents.mode" match="*">
-  <xsl:param name="side"/>
   <xsl:param name="side"/>
   <div class="sidebar-contents">
     <div class="inner">
@@ -152,6 +151,30 @@ common {html} stylesheet.
   </xsl:if>
 </xsl:template>
 
+<!--%# html.css.mode -->
+<xsl:template mode="html.css.mode" match="*">
+  <xsl:param name="direction">
+    <xsl:call-template name="l10n.direction"/>
+  </xsl:param>
+  <xsl:param name="left">
+    <xsl:call-template name="l10n.align.start">
+      <xsl:with-param name="direction" select="$direction"/>
+    </xsl:call-template>
+  </xsl:param>
+  <xsl:param name="right">
+    <xsl:call-template name="l10n.align.end">
+      <xsl:with-param name="direction" select="$direction"/>
+    </xsl:call-template>
+  </xsl:param>
+  <xsl:call-template name="tmpl.file">
+    <xsl:with-param name="file" select="'css/docbook.css.tmpl'"/>
+    <xsl:with-param name="node" select="."/>
+    <xsl:with-param name="direction" select="$direction"/>
+    <xsl:with-param name="left" select="$left"/>
+    <xsl:with-param name="right" select="$right"/>
+  </xsl:call-template>
+</xsl:template>
+
 
 <!--**==========================================================================
 db2html.division.div
diff --git a/xslt/docbook/html/db2xhtml.xsl b/xslt/docbook/html/db2xhtml.xsl
index a6238984..3aa47f75 100644
--- a/xslt/docbook/html/db2xhtml.xsl
+++ b/xslt/docbook/html/db2xhtml.xsl
@@ -49,7 +49,6 @@ DocBook documents into XHTML. This stylesheet sets the parameter
 <xsl:include href="db2html-callout.xsl"/>
 <xsl:include href="db2html-classsynopsis.xsl"/>
 <xsl:include href="db2html-cmdsynopsis.xsl"/>
-<xsl:include href="db2html-css.xsl"/>
 <xsl:include href="db2html-division.xsl"/>
 <xsl:include href="db2html-ebnf.xsl"/>
 <xsl:include href="db2html-funcsynopsis.xsl"/>


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