# SOFTWARE.
+find_path(DOCBOOK_XSL manpages/docbook.xsl
+ # Debian
+ /usr/share/xml/docbook/stylesheet/docbook-xsl
+ /usr/share/xml/docbook/stylesheet/nwalsh
+ # OpenSUSE
+ /usr/share/xml/docbook/stylesheet/nwalsh/current
+ # Arch
+ /usr/share/xml/docbook/xsl-stylesheets
+ # Fedora
+ /usr/share/sgml/docbook/xsl-stylesheets
+ # Fink
+ ${CMAKE_INSTALL_PREFIX}/share/xml/xsl/docbook-xsl
+ # FreeBSD
+ ${CMAKE_INSTALL_PREFIX}/share/xsl/docbook/
+ NO_DEFAULT_PATH)
+
+if(NOT DOCBOOK_XSL)
+ message(FATAL_ERROR "Could not find docbook xsl")
+endif()
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docbook-text-style.xsl.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/docbook-text-style.xsl)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docbook-html-style.xsl.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/docbook-html-style.xsl)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/manpage-style.xsl.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/manpage-style.xsl)
+
+
# Split up a string of the form DOCUMENT[.DOCUMENT][.LANGUAGE][.SECTION].EXTENSION
#
# There might be up to two parts in the document name. The language must be
else()
set(manpage_output "${CMAKE_CURRENT_BINARY_DIR}/${document}.${section}")
endif()
- set(manpage_stylesheet "${CMAKE_CURRENT_SOURCE_DIR}/manpage-style.xsl")
+ set(manpage_stylesheet "${CMAKE_CURRENT_BINARY_DIR}/manpage-style.xsl")
set(manpage_params)
install(FILES ${manpage_output}
set(html_output "${CMAKE_CURRENT_BINARY_DIR}/${document}.html")
endif()
set(html_params --stringparam base.dir ${html_output})
- set(html_stylesheet "${CMAKE_CURRENT_SOURCE_DIR}/docbook-html-style.xsl")
+ set(html_stylesheet "${CMAKE_CURRENT_BINARY_DIR}/docbook-html-style.xsl")
install(DIRECTORY ${html_output}
DESTINATION ${DOC_INSTALL}
OPTIONAL)
set(text_output "${CMAKE_CURRENT_BINARY_DIR}/${document}.text")
endif()
set(text_params --stringparam base.dir ${text_output})
- set(text_stylesheet "${CMAKE_CURRENT_SOURCE_DIR}/docbook-text-style.xsl")
+ set(text_stylesheet "${CMAKE_CURRENT_BINARY_DIR}/docbook-text-style.xsl")
file(RELATIVE_PATH text_output_relative ${CMAKE_CURRENT_BINARY_DIR} ${text_output})
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-
- <!-- Import our base stylesheet -->
- <xsl:import href="/usr/share/xml/docbook/stylesheet/docbook-xsl/xhtml-1_1/chunk.xsl" />
-
- <!-- Since we use xsltproc (not saxon), add a workaround to ensure UTF-8 -->
- <xsl:template xmlns="http://www.w3.org/1999/xhtml" name="head.content.generator">
- <xsl:param name="node" select="."/>
- <meta name="generator" content="DocBook {$DistroTitle} V{$VERSION}"/>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
- </xsl:template>
-
- <xsl:template name="generate.html.title"/>
-
- <xsl:template match="releaseinfo" mode="titlepage.mode">
- <xsl:apply-imports/>
- <hr/>
- </xsl:template>
-
- <xsl:param name="root.filename">index</xsl:param>
-
- <!-- We do not want a title in HTML. -->
- <xsl:param name="generate.meta.abstract" select="0"/>
-
- <!-- We do not want the first subsection on the same page as content. -->
- <xsl:param name="chunk.first.sections" select="0"/>
- <xsl:param name="chunk.section.depth" select="0"/>
- <xsl:param name="chunker.output.indent" select="'yes'"/>
-
- <xsl:param name="use.id.as.filename" select="1"/>
-
- <xsl:param name="toc.section.depth" select="1"/>
- <xsl:param name="generate.section.toc.level" select="0"/>
- <xsl:param name="section.label.includes.component.label" select="1"/>
- <xsl:param name="section.autolabel" select="1"/>
-
- <xsl:param name="generate.css.header" select="1"/>
-
-</xsl:stylesheet>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+ <!-- Import our base stylesheet -->
+ <xsl:import href="@DOCBOOK_XSL@/xhtml-1_1/chunk.xsl" />
+
+ <!-- Since we use xsltproc (not saxon), add a workaround to ensure UTF-8 -->
+ <xsl:template xmlns="http://www.w3.org/1999/xhtml" name="head.content.generator">
+ <xsl:param name="node" select="."/>
+ <meta name="generator" content="DocBook {$DistroTitle} V{$VERSION}"/>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </xsl:template>
+
+ <xsl:template name="generate.html.title"/>
+
+ <xsl:template match="releaseinfo" mode="titlepage.mode">
+ <xsl:apply-imports/>
+ <hr/>
+ </xsl:template>
+
+ <xsl:param name="root.filename">index</xsl:param>
+
+ <!-- We do not want a title in HTML. -->
+ <xsl:param name="generate.meta.abstract" select="0"/>
+
+ <!-- We do not want the first subsection on the same page as content. -->
+ <xsl:param name="chunk.first.sections" select="0"/>
+ <xsl:param name="chunk.section.depth" select="0"/>
+ <xsl:param name="chunker.output.indent" select="'yes'"/>
+
+ <xsl:param name="use.id.as.filename" select="1"/>
+
+ <xsl:param name="toc.section.depth" select="1"/>
+ <xsl:param name="generate.section.toc.level" select="0"/>
+ <xsl:param name="section.label.includes.component.label" select="1"/>
+ <xsl:param name="section.autolabel" select="1"/>
+
+ <xsl:param name="generate.css.header" select="1"/>
+
+</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-
- <xsl:import href="/usr/share/xml/docbook/stylesheet/docbook-xsl/xhtml-1_1/docbook.xsl" />
-
- <!-- Parameters for optimal text output. -->
- <xsl:param name="callout.graphics" select="0"/>
- <xsl:param name="callout.unicode" select="0"/>
- <xsl:param name="section.autolabel" select="1"/>
- <xsl:param name="section.label.includes.component.label" select="1"/>
-
- <!-- Centering and aligning title elements. -->
- <xsl:template match="/*/title[position()=1]" mode="titlepage.mode">
- <br/>
- <center>
- <xsl:apply-imports/>
- </center>
- <br/>
- <hr/> <!-- No underline, but at least something. -->
- </xsl:template>
- <xsl:template match="author|editor" mode="titlepage.mode">
- <center>
- <xsl:apply-imports/>
- </center>
- </xsl:template>
-
- <xsl:template match="releaseinfo" mode="titlepage.mode">
- <center>
- <xsl:apply-imports/>
- </center>
- <hr/>
- </xsl:template>
-
- <!-- Dirty hack to get a left margin for paragraphs etc. -->
- <xsl:template match="legalnotice/*
- |chapter/*[not(name(.)='section') and not(name(.)='title')]
- |section/*[not(name(.)='section') and not(name(.)='title')]
- |appendix/*[not(name(.)='section') and not(name(.)='title')]
- |footnote/*">
- <xsl:copy><table><tr><td>   </td><td>
- <xsl:apply-imports/>
- </td></tr></table></xsl:copy>
- </xsl:template>
-
- <!-- Skip URLs if it has something to print. -->
- <xsl:template match="ulink[.!='']">
- <xsl:copy-of select="."/>
- </xsl:template>
- <!-- Print URLs if nothing to print. -->
- <xsl:template match="ulink[.='']">
- <xsl:value-of select="@url"/>
- </xsl:template>
-
- <!-- Make clear where notes etc. begin and end. -->
- <xsl:template match="caution|important|note|tip|warning">
- <table width="80%" border="1">
- <colgroup>
- <col align="justify"/>
- </colgroup>
- <tbody>
- <tr>
- <td align="justify">
- <xsl:apply-imports/>
- </td>
- </tr>
- </tbody>
- </table>
- </xsl:template>
-
-</xsl:stylesheet>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+ <xsl:import href="@DOCBOOK_XSL@/xhtml-1_1/docbook.xsl" />
+
+ <!-- Parameters for optimal text output. -->
+ <xsl:param name="callout.graphics" select="0"/>
+ <xsl:param name="callout.unicode" select="0"/>
+ <xsl:param name="section.autolabel" select="1"/>
+ <xsl:param name="section.label.includes.component.label" select="1"/>
+
+ <!-- Centering and aligning title elements. -->
+ <xsl:template match="/*/title[position()=1]" mode="titlepage.mode">
+ <br/>
+ <center>
+ <xsl:apply-imports/>
+ </center>
+ <br/>
+ <hr/> <!-- No underline, but at least something. -->
+ </xsl:template>
+ <xsl:template match="author|editor" mode="titlepage.mode">
+ <center>
+ <xsl:apply-imports/>
+ </center>
+ </xsl:template>
+
+ <xsl:template match="releaseinfo" mode="titlepage.mode">
+ <center>
+ <xsl:apply-imports/>
+ </center>
+ <hr/>
+ </xsl:template>
+
+ <!-- Dirty hack to get a left margin for paragraphs etc. -->
+ <xsl:template match="legalnotice/*
+ |chapter/*[not(name(.)='section') and not(name(.)='title')]
+ |section/*[not(name(.)='section') and not(name(.)='title')]
+ |appendix/*[not(name(.)='section') and not(name(.)='title')]
+ |footnote/*">
+ <xsl:copy><table><tr><td>   </td><td>
+ <xsl:apply-imports/>
+ </td></tr></table></xsl:copy>
+ </xsl:template>
+
+ <!-- Skip URLs if it has something to print. -->
+ <xsl:template match="ulink[.!='']">
+ <xsl:copy-of select="."/>
+ </xsl:template>
+ <!-- Print URLs if nothing to print. -->
+ <xsl:template match="ulink[.='']">
+ <xsl:value-of select="@url"/>
+ </xsl:template>
+
+ <!-- Make clear where notes etc. begin and end. -->
+ <xsl:template match="caution|important|note|tip|warning">
+ <table width="80%" border="1">
+ <colgroup>
+ <col align="justify"/>
+ </colgroup>
+ <tbody>
+ <tr>
+ <td align="justify">
+ <xsl:apply-imports/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </xsl:template>
+
+</xsl:stylesheet>
+++ /dev/null
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0">
-
-<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl" />
-
-<xsl:param name="man.output.encoding" select="'UTF-8'" />
-
-<xsl:template match="email"><<xsl:apply-templates/>></xsl:template>
-
-<xsl:template match="date">
- <xsl:call-template name="datetime.format">
- <xsl:with-param name="date" select="."/>
- <xsl:with-param name="format" select="'d B Y'"/>
- </xsl:call-template>
-</xsl:template>
-
-</xsl:stylesheet>
--- /dev/null
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0">
+
+<xsl:import href="@DOCBOOK_XSL@/manpages/docbook.xsl" />
+
+<xsl:param name="man.output.encoding" select="'UTF-8'" />
+
+<xsl:template match="email"><<xsl:apply-templates/>></xsl:template>
+
+<xsl:template match="date">
+ <xsl:call-template name="datetime.format">
+ <xsl:with-param name="date" select="."/>
+ <xsl:with-param name="format" select="'d B Y'"/>
+ </xsl:call-template>
+</xsl:template>
+
+</xsl:stylesheet>