[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] Improved support for building pdf/ps/txt versions of d-i manual (was: Creating pdf for Installation manual)



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

With the suggestions from Geert & Mitch (thank you both!), I have managed to 
build pdf and ps versions of the manual.

Attached is a patch against current CVS doc/manuals/build/ that improves 
support and documentation for building these files.

Changelog:
 * improved support for building pdf/ps/txt versions of the manual
   - changed link for $foprocessor to /usr/bin/fop
   - split off script for building the files from buildone.sh into buildfop.sh
   - added instructions in README
   - added support for papersize in style.fo.xsl

Please review my patch and apply if correct.

Thanks, FJP
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFAWjmtgm/Kwh6ICoQRAiwvAJ9BxX8JZZGmWNKEszIzVKld0H8uugCfR5Be
ZdmcQlSAoM2+9XxcZu8bkgI=
=TFXQ
-----END PGP SIGNATURE-----
Common subdirectories: ./old/CVS and ./CVS
diff -u -N ./old/README ./README
--- ./old/README	Tue Jan 27 18:06:10 2004
+++ ./README	Fri Mar 19 00:20:11 2004
@@ -3,6 +3,9 @@
 
 docbook, docbook-xml, docbook-xsl, xsltproc, (fop)
 
+NOTE
+You can't build the documentation on Woody as packages are required
+that are not available for Woody.
 
 2. Included Files:
 ==================
@@ -30,11 +33,14 @@
                 base tarballs) for various architectures.
 
 buildone.sh: For given architecture and language builds one set of
-             documentation in .html, .fo (and sometimes .pdf).
+             documentation in .html and .fo.
 
 build.sh: For each language and architecture calls buildone.sh, moves
           rendered documentation somewhere and cleans after that.
 
+buildfop.sh: For given language builds pdf, ps or plain text files
+             (based on .fo generated with buildone.sh).
+
 clear.sh: Does the actual cleaning.
 
 style-common.xsl: Common parameters for xsl transformation.
@@ -44,8 +50,8 @@
 style-fo.xsl: FO-specific parameters for xsl transformation.
 
 
-3. Building:
-============
+3. Building FO and HTML files:
+==============================
 
 After you customize build*.sh and style-*.xsl to suit your needs
 (esp. various paths), you can run
@@ -56,5 +62,37 @@
 language (en). For mass building you can use ./build.sh script.
 
 
--- 
-27. January 2004 Miroslav Kure 
+4. Building PDF, PS and TXT files:
+==================================
+To build these document types you will need to install some extra
+packages.
+
+Required packages:
+- fop  (only available in unstable but installs OK in testing, you'll
+        also need libbatik-java from unstable)
+- java (I used j2re1.3 for testing from blackdown)
+- and their (many) dependencies
+
+To build a PDF-file for one specific language you can run:
+./buildfop.sh <doctype> <language>
+where <doctype> is one of 'pdf', 'ps' or 'txt'.
+
+This will work only _after_ you have run the normal buildproces for
+the selected language.
+To include the build of pdf files in the normal build proces, uncomment
+the line chaining buildfop.sh in the buildone.sh script. However, see
+the note below.
+
+The documents are generated by default for papersize A4, but this can
+be changed to letter (and other sizes) in style-fo.xsl.
+
+NOTE
+The last step of the build process may fail because of missing hyphenation
+support for a language. (The files for some languages have been removed
+because of licencing issues; supported are: en, es, fi, hu, it, pl, pt, ru.)
+
+An extensive reference on FOP can be found at:
+- http://xml.apache.org/fop/
+
+--
+27. January 2004 Miroslav Kure
diff -u -N ./old/buildfop.sh ./buildfop.sh
--- ./old/buildfop.sh	Thu Jan  1 01:00:00 1970
+++ ./buildfop.sh	Fri Mar 19 00:04:16 2004
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+if [ "$#" -ne 2 ]; then
+    echo "Usage: $0 doctype lang"
+    exit 1
+fi
+
+doctype=${1-pdf}
+language=${2-en}
+
+case $doctype in
+    pdf|ps|txt)
+        ;;
+    *)
+        echo "Usage: $0 doctype lang"
+        echo "doctype is one of pdf (adobe acrobat), ps (postscript), txt (plain text)"
+        exit 1
+        ;;
+esac
+
+## First we define some paths to various xsl stylesheets
+stylesheet_profile="/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/profiling/profile.xsl"
+stylesheet_fo="style-fo.xsl"
+
+## Location to our tools
+xsltprocessor=xsltproc
+foprocessor=/usr/bin/fop
+
+if [ -f install.${language}.profiled.xml ] ; then
+	## ...and also to the .fo...
+	$xsltprocessor --output install.${language}.fo \
+               $stylesheet_fo install.${language}.profiled.xml
+
+	## ...from which we can generate (little bit ugly) pdf/ps/txt.
+	$foprocessor -fo install.${language}.fo -${doctype} install.${language}.${doctype}
+else
+	echo "install.${language}.profiled.xml not found; please run buildone.sh first."
+fi
+
diff -u -N ./old/buildone.sh ./buildone.sh
--- ./old/buildone.sh	Thu Mar 11 18:20:09 2004
+++ ./buildone.sh	Fri Mar 19 00:02:26 2004
@@ -11,11 +11,9 @@
 ## First we define some paths to various xsl stylesheets
 stylesheet_profile="/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/profiling/profile.xsl"
 stylesheet_html="style-html.xsl"
-stylesheet_fo="style-fo.xsl"
 
 ## Location to our tools
 xsltprocessor=xsltproc
-foprocessor=./fop/fop.sh
 
 ## Build preparation
 dynamic="dynamic.ent"
@@ -83,7 +81,7 @@
     m68k)
         archspec="m68k;not-i386;not-s390;not-powerpc;not-alpha"
 	kernelversion="2.2.25"
-	
+
         fdisk="atari-fdisk.txt;mac-fdisk.txt;amiga-fdisk.txt;pmac-fdisk.txt"
         network="supports-tftp;supports-rarp;supports-dhcp;supports-bootp;supports-nfsroot"
         boot="supports-floppy-boot;bootable-disk"
@@ -171,14 +169,10 @@
                --stringparam profile.condition "$cond" \
                --output install.${language}.profiled.xml \
                $stylesheet_profile install.${language}.xml
-		   
+
 ## ...then we convert it to the .html...
 $xsltprocessor $stylesheet_html install.${language}.profiled.xml
-		   
-## ...and also to the .fo...
-# $xsltprocessor --output install.${language}.fo \
-#                $stylesheet_fo install.${language}.profiled.xml
-		   
-## ...from which we can generate (little bit ugly) pdf/ps/txt.
-# $foprocessor -fo install.${language}.fo -pdf install.${language}.pdf
+
+## ...and optionally we can generate (little bit ugly) pdf/ps/txt.
+# ./buildfop.sh pdf ${language}
 
diff -u -N ./old/clear.sh ./clear.sh
--- ./old/clear.sh	Tue Jan 27 18:06:10 2004
+++ ./clear.sh	Fri Mar 19 00:22:10 2004
@@ -4,4 +4,6 @@
 rm -f *.html
 rm -f install.*.fo
 rm -f install.*.pdf
+rm -f install.*.ps
+rm -f install.*.txt
 rm -f install.*.profiled.xml
Common subdirectories: ./old/old and ./old
diff -u -N ./old/style-fo.xsl ./style-fo.xsl
--- ./old/style-fo.xsl	Tue Jan 27 18:06:10 2004
+++ ./style-fo.xsl	Wed Mar 17 22:56:56 2004
@@ -22,4 +22,7 @@
 <!-- Do we want fancy icons around note, warning, etc.? -->
 <xsl:param name="admon.graphics">0</xsl:param>
 
+<!-- Set paper size; use A4 or USLetter -->
+<xsl:param name="paper.type">A4</xsl:param>
+
 </xsl:stylesheet>

Reply to: