]> git.proxmox.com Git - pve-docs.git/commitdiff
pve-dblatex.xsl: define all dblatec settings inside this file
authorDietmar Maurer <dietmar@proxmox.com>
Sat, 5 Nov 2016 11:13:42 +0000 (12:13 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Sat, 5 Nov 2016 11:13:42 +0000 (12:13 +0100)
And overwrite formalpara template, adding newline after title.

Makefile
asciidoc/pve-dblatex.xsl [new file with mode: 0644]

index 9af35945bd96fcaf6dcfef119945a2c80c9fb1c0..292cb5d998ddc0a12d785fcf9e6abba209316fa4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -120,7 +120,7 @@ pve-admin-guide.pdf: ${PVE_ADMIN_GUIDE_ADOCDEPENDS} docinfo.xml pve-admin-guide-
        inkscape -z -D --export-pdf=proxmox-logo.pdf images/proxmox-logo.svg
        inkscape -z -D --export-pdf=proxmox-ci-header.pdf images/proxmox-ci-header.svg
        grep ">Release ${DOCRELEASE}<" pve-admin-guide-docinfo.xml || (echo "wrong release in  pve-admin-guide-docinfo.xml" && false);
-       a2x -a docinfo -a docinfo1 -f pdf -L --dblatex-opts "-P latex.output.revhistory=0" --dblatex-opts "-P latex.class.options=12pt" --dblatex-opts "-P doc.section.depth=2 -P toc.section.depth=2" --dblatex-opts "-P doc.publisher.show=0 -s asciidoc/dblatex-custom.sty" pve-admin-guide.adoc
+       a2x -a docinfo -a docinfo1 -f pdf -L --dblatex-opts "-p ./asciidoc/pve-dblatex.xsl -s asciidoc/dblatex-custom.sty" pve-admin-guide.adoc
        rm proxmox-logo.pdf proxmox-ci-header.pdf
 
 pve-admin-guide.epub: ${PVE_ADMIN_GUIDE_ADOCDEPENDS}
diff --git a/asciidoc/pve-dblatex.xsl b/asciidoc/pve-dblatex.xsl
new file mode 100644 (file)
index 0000000..d5d74d7
--- /dev/null
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!--
+dblatex(1) XSL user stylesheet for asciidoc(1).
+See dblatex(1) -p option.
+
+modified for Proxmox VE documenation.
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+  <!-- TOC links in the titles, and in blue. -->
+  <xsl:param name="latex.hyperparam">colorlinks,linkcolor=blue,pdfstartview=FitH</xsl:param>
+  <xsl:param name="doc.publisher.show">0</xsl:param>
+  <xsl:param name="doc.lot.show"></xsl:param>
+  <xsl:param name="term.breakline">1</xsl:param>
+  <xsl:param name="doc.collab.show">0</xsl:param>
+  <xsl:param name="doc.publisher.show">0</xsl:param>
+  <xsl:param name="doc.section.depth">2</xsl:param>
+  <xsl:param name="toc.section.depth">2</xsl:param>
+  <xsl:param name="table.in.float">0</xsl:param>
+  <xsl:param name="monoseq.hyphenation">0</xsl:param>
+  <xsl:param name="latex.output.revhistory">0</xsl:param>
+  <xsl:param name="latex.class.options">12pt</xsl:param>
+
+
+  <!-- This doesn't work, don't know why, see:
+  http://dblatex.sourceforge.net/html/manual/apas03.html
+  ./docbook-xsl/common.xsl
+  -->
+  <!--
+  <xsl:param name="doc.toc.show">
+    <xsl:choose>
+      <xsl:when test="/processing-instruction('asciidoc-toc')">
+1
+      </xsl:when>
+      <xsl:otherwise>
+0
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:param>
+  <xsl:param name="doc.lot.show">
+    <xsl:choose>
+      <xsl:when test="/book">
+figure,table,equation,example
+      </xsl:when>
+    </xsl:choose>
+  </xsl:param>
+  -->
+  <xsl:param name="doc.toc.show">1</xsl:param>
+
+  <!--
+    Override default literallayout template.
+    See `./dblatex/dblatex-readme.txt`.
+  -->
+  <xsl:template match="address|literallayout[@class!='monospaced']">
+    <xsl:text>\begin{alltt}</xsl:text>
+    <xsl:text>&#10;\normalfont{}&#10;</xsl:text>
+    <xsl:apply-templates/>
+    <xsl:text>&#10;\end{alltt}</xsl:text>
+  </xsl:template>
+
+  <xsl:template match="processing-instruction('asciidoc-pagebreak')">
+    <!-- force hard pagebreak, varies from 0(low) to 4(high) -->
+    <xsl:text>\pagebreak[4] </xsl:text>
+    <xsl:apply-templates />
+    <xsl:text>&#10;</xsl:text>
+  </xsl:template>
+
+  <xsl:template match="processing-instruction('asciidoc-br')">
+    <xsl:text>\newline&#10;</xsl:text>
+  </xsl:template>
+
+  <xsl:template match="processing-instruction('asciidoc-hr')">
+    <!-- draw a 444 pt line (centered) -->
+    <xsl:text>\begin{center}&#10; </xsl:text>
+    <xsl:text>\line(1,0){444}&#10; </xsl:text>
+    <xsl:text>\end{center}&#10; </xsl:text>
+  </xsl:template>
+
+  <xsl:template match="formalpara">
+    <xsl:text>&#10;{\bf </xsl:text>
+    <xsl:call-template name="normalize-scape">
+      <xsl:with-param name="string" select="title"/>
+    </xsl:call-template>
+    <xsl:text>} \\ </xsl:text>
+    <xsl:call-template name="label.id"/>
+    <xsl:apply-templates/>
+    <xsl:text>&#10;</xsl:text>
+    <xsl:text>&#10;</xsl:text>
+  </xsl:template>
+
+</xsl:stylesheet>
+