chiark / gitweb /
Improved text output. (Better parametrisation of XSL and w3m.)
authordebacle <debacle@313b444b-1b9f-4f58-a734-7bb04f332e8d>
Fri, 13 Jun 2008 13:36:31 +0000 (13:36 +0000)
committerdebacle <debacle@313b444b-1b9f-4f58-a734-7bb04f332e8d>
Fri, 13 Jun 2008 13:36:31 +0000 (13:36 +0000)
git-svn-id: svn://anonscm.debian.org/ddp/manuals/trunk/developers-reference@5237 313b444b-1b9f-4f58-a734-7bb04f332e8d

Makefile
txt.xsl

index 2622444..8393f21 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -76,7 +76,7 @@ endif
 developers-reference.txt:      $(CURDIR)/developers-reference.txt
 %/developers-reference.txt:    $(addprefix %/,$(SOURCES))
        $(XP) $(DBK2HTML1) $(@D)/index.dbk \
-           | w3m -cols 65 -dump -T text/html > $@
+           | w3m -cols 70 -dump -no-graph -T text/html > $@
 
 developers-reference.pdf:       $(CURDIR)/developers-reference.pdf
 %/developers-reference.pdf:     $(addprefix %/,$(SOURCES))
diff --git a/txt.xsl b/txt.xsl
index 227d812..81ab1b1 100644 (file)
--- a/txt.xsl
+++ b/txt.xsl
@@ -3,8 +3,12 @@
                 version="1.0">
   <xsl:import
     href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"/>
-  <xsl:param name="section.autolabel">1</xsl:param>
-  <xsl:param name="section.label.includes.component.label">1</xsl:param>
+
+  <!-- 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"/>
   <xsl:param name="generate.toc">
   appendix  title
   article/appendix  nop
   qandadiv  toc
   qandaset  toc
   reference toc,title
-  sect1     toc
-  sect2     toc
-  sect3     toc
-  sect4     toc
-  sect5     toc
   section   toc
   set       toc,title
   </xsl:param>
+
+  <!-- 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>&#xa0;&#xa0;&#xa0;</td><td>
+    <xsl:apply-imports/>
+    </td></tr></table></xsl:copy>
+  </xsl:template>
+
 </xsl:stylesheet>