diff options
author | Shaun McCance <shaunm@redhat.com> | 2020-10-17 10:24:27 -0400 |
---|---|---|
committer | Shaun McCance <shaunm@redhat.com> | 2020-10-17 10:29:31 -0400 |
commit | c31954f842688bba4bc13932cd31e33c759e342e (patch) | |
tree | 2104e26bfff1ca6150e43d2463f0d3fa2298f4d8 | |
parent | 6f4a6a6e4a56a68d28bddbc2efaced14fba0e01e (diff) | |
download | yelp-xsl-c31954f842688bba4bc13932cd31e33c759e342e.tar.gz |
Use text templates for DocBook CSS
-rw-r--r-- | xslt/common/css/docbook.css.tmpl | 175 | ||||
-rw-r--r-- | xslt/docbook/html/Makefile.am | 1 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-css.xsl | 224 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-division.xsl | 25 | ||||
-rw-r--r-- | 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-css.xsl b/xslt/docbook/html/db2html-css.xsl deleted file mode 100644 index 496a3718..00000000 --- a/xslt/docbook/html/db2html-css.xsl +++ /dev/null @@ -1,224 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- --> -<!-- -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU Lesser General Public License as published by the Free -Software Foundation; either version 2 of the License, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more -details. - -You should have received a copy of the GNU Lesser General Public License -along with this program; see the file COPYING.LGPL. If not, see <http://www.gnu.org/licenses/>. ---> - -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns="http://www.w3.org/1999/xhtml" - version="1.0"> - -<!--!!========================================================================== -DocBook to HTML - CSS - -REMARK: Describe this module ---> - - -<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:text> -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-</xsl:text><xsl:value-of select="$left"/><xsl:text>: solid 1px; -} - -td.td-colsep { border-</xsl:text><xsl:value-of select="$right"/><xsl:text>: solid 1px; } -td.td-rowsep { border-bottom: solid 1px; } - -<!-- == bibliography == --> -span.bibliolabel { - font-weight: bold; - color: </xsl:text><xsl:value-of select="$color.fg.dark"/><xsl:text>; -} -div.biblioentry span.title { - font-weight: normal; - font-style: italic; -} -span.citetitle { - font-style: italic; -} - -<!-- == block == --> -div.epigraph { - text-align: </xsl:text><xsl:value-of select="$right"/><xsl:text>; - margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 20%; - margin-</xsl:text><xsl:value-of select="$right"/><xsl:text>: 0; - color: </xsl:text><xsl:value-of select="$color.fg.dark"/><xsl:text>; -} -div.programlisting .userinput { - font-weight: bold; - color: </xsl:text><xsl:value-of select="$color.fg.dark"/><xsl:text>; -} -div.address, div.literallayout { white-space: pre; } - - -<!-- == footnotes == --> -div.footnotes { - border-top: solid 2px </xsl:text> - <xsl:value-of select="$color.gray"/><xsl:text>; -} -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-</xsl:text><xsl:value-of select="$right"/><xsl:text>: 0.83em; - background-color: </xsl:text><xsl:value-of select="$color.bg.gray"/><xsl:text>; -} -div.footnote > a.footnote + p { display: inline-block; margin: 0; } -a.footnote:hover, div.footnote > a.footnote:hover { - background-color: </xsl:text><xsl:value-of select="$color.bg.blue"/><xsl:text>; - box-shadow: 0 0 2px </xsl:text> - <xsl:value-of select="$color.blue"/><xsl:text>; -} - -<!-- == indexes == --> -dt.ixprimary { - font-weight: bold; - color: </xsl:text><xsl:value-of select="$color.fg.dark"/><xsl:text>; -} -dt.ixprimary * { font-style: normal; } -dt.ixprimary + dt.ixprimary { margin-top: 1em; } -dd.ixsecondary { - color: </xsl:text><xsl:value-of select="$color.fg.gray"/><xsl:text>; -} -dt.ixsecondary, dt.ixtertiary { margin-top: 0.2em; } -dd.ixlink, dd.ixsee, dd.ixseealso { - color: </xsl:text><xsl:value-of select="$color.fg.gray"/><xsl:text>; -} -dd.ixlink + dd, dd.ixsee + dd, dd.ixseealso + dd { - margin-top: 0.2em; -} -dt.ixsecondary:before, dt.ixtertiary:before { - content: "⏺"; - color: </xsl:text><xsl:value-of select="$color.fg.gray"/><xsl:text>; -} -dd.ixlink:before { - content: "⏺"; - color: </xsl:text><xsl:value-of select="$color.blue"/><xsl:text>; -} -dd.ixsee:before, dd.ixseealso:before { - content: "⏺"; - color: </xsl:text><xsl:value-of select="$color.gray"/><xsl:text>; -} - -<!-- == 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-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.72em; } -div.simplelist table { margin-left: 0; border: none; } -div.simplelist td { - padding: 0.5em; - border-</xsl:text><xsl:value-of select="$left"/><xsl:text>: solid 1px </xsl:text> - <xsl:value-of select="$color.gray"/><xsl:text>; -} -div.simplelist td:first-child { - 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; } -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: </xsl:text><xsl:value-of select="$color.fg.dark"/><xsl:text>; -} -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: </xsl:text><xsl:value-of select="$left"/><xsl:text>; - margin-</xsl:text><xsl:value-of select="$right"/><xsl:text>: 1em; - font-weight: bold; - color: </xsl:text><xsl:value-of select="$color.fg.dark"/><xsl:text>; -} -dl.qandaset ol, dl.qandaset ul, dl.qandaset table { clear: both; } - -div.synopfragment { padding-top: 0.5em; } -span.co { - border-radius: 4px; - background-color: </xsl:text> - <xsl:value-of select="$color.bg.yellow"/><xsl:text>; - outline: solid 1px </xsl:text> - <xsl:value-of select="$color.yellow"/><xsl:text>; -} -span.co a { text-decoration: none; } -span.co a:hover { text-decoration: none; } -div.co { - margin: 0; - float: </xsl:text><xsl:value-of select="$left"/><xsl:text>; - clear: both; -} -</xsl:text> -</xsl:template> - -</xsl:stylesheet> 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 @@ -59,7 +59,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"> <div class="title"> @@ -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"/> |