diff options
author | Daniel Burrows <dburrows@debian.org> | 2011-04-02 11:05:20 -0700 |
---|---|---|
committer | Daniel Burrows <dburrows@debian.org> | 2011-04-02 11:05:20 -0700 |
commit | de851905685f3b874fee0978587e406e83c697a0 (patch) | |
tree | 81524131f04ff1ebe1f9f894bb6c66a353487b58 | |
parent | 1b7122eb71649a3d1b1ca178d66e1a9d224a813e (diff) | |
download | aptitude-de851905685f3b874fee0978587e406e83c697a0.tar.gz |
Replace the db2latex generation for the docs with fo -> pdf generation.
db2latex is pretty much dead and built on a deprecated stack. I
still wish there was a way to get decent latex output from docbook,
but it seems that we're in a "never the twain shall meet" situation
for now.
Note that aptitude's documentation can't be processed through
the packaged version of fop until a bug in fop is fixed (filed
in debbugs with a patch).
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | doc/aptitude-db2latex.xsl | 86 | ||||
-rw-r--r-- | doc/aptitude-fo.xsl | 12 | ||||
-rw-r--r-- | doc/en/Makefile.am | 22 |
4 files changed, 25 insertions, 97 deletions
@@ -67,11 +67,13 @@ doc/en/aptitude-create-state-bundle.1 doc/en/aptitude-run-state-bundle.1 doc/en/aptitude.8 doc/en/doc-css-stamp +doc/en/doc-fo-stamp doc/en/doc-html-stamp doc/en/doc-stamp doc/en/images/Makefile doc/en/images/Makefile.in doc/en/man-stamp +doc/en/output-fo/ doc/en/output-html/ doc/en/output-txt/ doc/es/Makefile diff --git a/doc/aptitude-db2latex.xsl b/doc/aptitude-db2latex.xsl deleted file mode 100644 index a050dad0..00000000 --- a/doc/aptitude-db2latex.xsl +++ /dev/null @@ -1,86 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<!-- Magic: --> - -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - version="1.0"> - -<xsl:import href="/usr/share/xml/docbook/stylesheet/db2latex/latex/docbook.xsl"/> - -<xsl:import href="aptitude-common.xsl"/> - -<xsl:variable name="insert.xref.page.number">1</xsl:variable> - -<xsl:variable name='latex.use.ltxtable'>1</xsl:variable> - -<xsl:variable name="admon.graphics.path">/usr/share/xml/docbook/stylesheet/db2latex/latex/figures</xsl:variable> - -<xsl:variable name="latex.book.preamble.post">\usepackage[dvips]{geometry}\geometry{papersize={6in,9in}}</xsl:variable> - -<!-- <xsl:variable name="latex.book.preamble.post">\setlength{\pdfpagewidth}{6in}\setlength{\pdfpageheight}{9in}</xsl:variable> --> - <xsl:template match="imagedata" name="imagedata"> - <xsl:param name="filename"> - <xsl:choose> - <xsl:when test="@entityref"> - <xsl:value-of select="unparsed-entity-uri(@entityref)"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="@fileref"/> - </xsl:otherwise> - </xsl:choose> - </xsl:param> - <xsl:param name="is.imageobjectco" select="false()"/> - <xsl:variable name="width"> - <xsl:choose> - <xsl:when test="contains(@width, '%') and substring-after(@width, '%')=''"> - <xsl:value-of select="number(substring-before(@width, '%')) div 100"/> - <xsl:text>\textwidth</xsl:text> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="@width"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:if test="$width!='' and (@scalefit='0' or count(@scale)>0)"> - <xsl:text>\makebox[</xsl:text><xsl:value-of select='$width' /><xsl:text>]</xsl:text> - </xsl:if> - <!-- TODO this logic actually needs to make decisions based on the ALLOWED imagedata, - not all the imagedata present in the source file. --> - <xsl:choose> - <xsl:when test="$is.imageobjectco=1"> - <xsl:text>{\begin{overpic}[</xsl:text> - </xsl:when> - <xsl:otherwise> - <xsl:text>{\noindent\includegraphics[</xsl:text> - </xsl:otherwise> - </xsl:choose> - <xsl:choose> - <xsl:when test="@scale"> - <xsl:text>scale=</xsl:text> - <xsl:value-of select="number(@scale) div 100"/> - </xsl:when> - <xsl:when test="$width!='' and @scalefit='1'"> - <xsl:text>width=</xsl:text><xsl:value-of select="normalize-space($width)"/> - </xsl:when> - <xsl:when test="@depth!='' and @scalefit='1'"> - <xsl:text>height=</xsl:text><xsl:value-of select="normalize-space(@depth)"/> - </xsl:when> - </xsl:choose> - <xsl:choose> - <xsl:when test="@format = 'PRN'"><xsl:text>,angle=270</xsl:text></xsl:when> - </xsl:choose> - <xsl:text>]{</xsl:text> - <xsl:value-of select="$filename"/> - <xsl:choose> - <xsl:when test="$is.imageobjectco=1"> - <xsl:text>} \calsscale </xsl:text> - <xsl:apply-templates select="ancestor::imageobjectco/areaspec//area"/> - <xsl:text>\end{overpic}}</xsl:text> - </xsl:when> - <xsl:otherwise> - <xsl:text>}}</xsl:text> - </xsl:otherwise> - </xsl:choose> - </xsl:template> - -</xsl:stylesheet> diff --git a/doc/aptitude-fo.xsl b/doc/aptitude-fo.xsl new file mode 100644 index 00000000..36a641ac --- /dev/null +++ b/doc/aptitude-fo.xsl @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- Magic: --> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + +<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/fo/docbook.xsl"/> + +<xsl:import href="aptitude-common.xsl"/> + +</xsl:stylesheet> diff --git a/doc/en/Makefile.am b/doc/en/Makefile.am index 686a3102..41341fd2 100644 --- a/doc/en/Makefile.am +++ b/doc/en/Makefile.am @@ -19,7 +19,7 @@ man_MANS=aptitude.8 aptitude-create-state-bundle.1 aptitude-run-state-bundle.1 all-local: doc-stamp clean-local: - -rm -fr output-html/ output-txt/ output-man/ + -rm -fr output-fo/ output-html/ output-txt/ output-man/ -rm -f doc-stamp doc-css-stamp doc-html-stamp doc-txt-stamp man-stamp -rm -fr aptitude.8 aptitude-create-state-bundle.1 aptitude-run-state-bundle.1 -rm -fr $(README) @@ -34,7 +34,7 @@ install-data-hook: doc-stamp: doc-html-stamp doc-css-stamp $(README) man-stamp touch doc-stamp -db2latex: doc-db2latex-stamp +fo: doc-fo-stamp man-stamp: $(srcdir)/aptitude.xml $(srcdir)/manpage.xml $(srcdir)/../aptitude-man.xsl -rm -fr output-man @@ -49,17 +49,17 @@ $(README): $(srcdir)/aptitude.xml $(srcdir)/manpage.xml $(srcdir)/../aptitude-tx xsltproc -o output-txt/index.html $(srcdir)/../aptitude-txt.xsl $(srcdir)/aptitude.xml $(HTML2TEXT) output-txt/index.html | $(srcdir)/../fixup-text > $(README) -doc-db2latex-stamp: output-db2latex/aptitude.tex $(IMAGES) - ln -s ../images output-db2latex/images -# Run pdflatex 3 times just to be extra sure that it converges. - cd output-db2latex && pdflatex -interaction nonstopmode aptitude.tex && pdflatex -interaction nonstopmode aptitude.tex && pdflatex -interaction nonstopmode aptitude.tex - touch doc-db2latex-stamp +doc-fo-stamp: output-fo/aptitude.fo $(IMAGES) + -rm -fr output-fo/ + xsltproc -o output-fo/aptitude.fo $(srcdir)/../aptitude-fo.xsl $(srcdir)/aptitude.xml -output-db2latex/aptitude.tex: aptitude.xml manpage.xml $(srcdir)/../aptitude-db2latex.xsl $(srcdir)/../aptitude-common.xsl - -rm -fr output-db2latex - mkdir output-db2latex - xsltproc -o output-db2latex/aptitude.tex $(srcdir)/../aptitude-db2latex.xsl $(srcdir)/aptitude.xml + mkdir output-fo/images/ + ln -f $(srcdir)/images/* output-fo/images/ + for x in caution draft important note tip warning; do ln -s /usr/share/xml/docbook/stylesheet/nwalsh/images/$$x.png output-fo/images/; done + touch doc-fo-stamp +doc-pdf: doc-fo-stamp + fop output-fo/aptitude.fo -pdf output-fo/aptitude.pdf doc-css-stamp: doc-html-stamp $(srcdir)/../aptitude.css rm -f output-html/aptitude.css |