Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I've been doing some manual writing with DocBook, under cygwin, to produce One Page HTML, Many Pages HTML, CHM and PDF.</p> <p>I installed the following:</p> <ol> <li>The <a href="http://www.docbook.org" rel="nofollow noreferrer">docbook</a> stylesheets (xsl) repository.</li> <li>xmllint, to test if the xml is correct.</li> <li>xsltproc, to process the xml with the stylesheets.</li> <li><a href="http://xmlgraphics.apache.org/fop/download.html" rel="nofollow noreferrer">Apache's fop</a>, to produce PDF's.I make sure to add the installed folder to the PATH.</li> <li>Microsoft's <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=00535334-c8a6-452f-9aa0-d597d16580cc&amp;displaylang=en" rel="nofollow noreferrer">HTML Help Workshop</a>, to produce CHM's. I make sure to add the installed folder to the PATH.</li> </ol> <p><strong>Edit</strong>: In the below code I'm using more than the 2 files. If someone wants a cleaned up version of the scripts and the folder structure, please contact me: guscarreno (squiggly/at) googlemail (period/dot) com</p> <p>I then use a configure.in: </p> <pre><code>AC_INIT(Makefile.in) FOP=fop.sh HHC=hhc XSLTPROC=xsltproc AC_ARG_WITH(fop, [ --with-fop Where to find Apache FOP], [ if test "x$withval" != "xno"; then FOP="$withval" fi ] ) AC_PATH_PROG(FOP, $FOP) AC_ARG_WITH(hhc, [ --with-hhc Where to find Microsoft Help Compiler], [ if test "x$withval" != "xno"; then HHC="$withval" fi ] ) AC_PATH_PROG(HHC, $HHC) AC_ARG_WITH(xsltproc, [ --with-xsltproc Where to find xsltproc], [ if test "x$withval" != "xno"; then XSLTPROC="$withval" fi ] ) AC_PATH_PROG(XSLTPROC, $XSLTPROC) AC_SUBST(FOP) AC_SUBST(HHC) AC_SUBST(XSLTPROC) HERE=`pwd` AC_SUBST(HERE) AC_OUTPUT(Makefile) cat &gt; config.nice &lt;&lt;EOT #!/bin/sh ./configure \ --with-fop='$FOP' \ --with-hhc='$HHC' \ --with-xsltproc='$XSLTPROC' \ EOT chmod +x config.nice </code></pre> <p>and a Makefile.in: </p> <pre><code>FOP=@FOP@ HHC=@HHC@ XSLTPROC=@XSLTPROC@ HERE=@HERE@ # Subdirs that contain docs DOCS=appendixes chapters reference XML_CATALOG_FILES=./build/docbook-xsl-1.71.0/catalog.xml export XML_CATALOG_FILES all: entities.ent manual.xml html clean: @echo -e "\n=== Cleaning\n" @-rm -f html/*.html html/HTML.manifest pdf/* chm/*.html chm/*.hhp chm/*.hhc chm/*.chm entities.ent .ent @echo -e "Done.\n" dist-clean: @echo -e "\n=== Restoring defaults\n" @-rm -rf .ent autom4te.cache config.* configure Makefile html/*.html html/HTML.manifest pdf/* chm/*.html chm/*.hhp chm/*.hhc chm/*.chm build/docbook-xsl-1.71.0 @echo -e "Done.\n" entities.ent: ./build/mkentities.sh $(DOCS) @echo -e "\n=== Creating entities\n" @./build/mkentities.sh $(DOCS) &gt; .ent @if [ ! -f entities.ent ] || [ ! cmp entities.ent .ent ]; then mv .ent entities.ent ; fi @echo -e "Done.\n" # Build the docs in chm format chm: chm/htmlhelp.hpp @echo -e "\n=== Creating CHM\n" @echo logo.png &gt;&gt; chm/htmlhelp.hhp @echo arrow.gif &gt;&gt; chm/htmlhelp.hhp @-cd chm &amp;&amp; "$(HHC)" htmlhelp.hhp @echo -e "Done.\n" chm/htmlhelp.hpp: entities.ent build/docbook-xsl manual.xml build/chm.xsl @echo -e "\n=== Creating input for CHM\n" @"$(XSLTPROC)" --output ./chm/index.html ./build/chm.xsl manual.xml # Build the docs in HTML format html: html/index.html html/index.html: entities.ent build/docbook-xsl manual.xml build/html.xsl @echo -e "\n=== Creating HTML\n" @"$(XSLTPROC)" --output ./html/index.html ./build/html.xsl manual.xml @echo -e "Done.\n" # Build the docs in PDF format pdf: pdf/manual.fo @echo -e "\n=== Creating PDF\n" @"$(FOP)" ./pdf/manual.fo ./pdf/manual.pdf @echo -e "Done.\n" pdf/manual.fo: entities.ent build/docbook-xsl manual.xml build/pdf.xsl @echo -e "\n=== Creating input for PDF\n" @"$(XSLTPROC)" --output ./pdf/manual.fo ./build/pdf.xsl manual.xml check: manual.xml @echo -e "\n=== Checking correctness of manual\n" @xmllint --valid --noout --postvalid manual.xml @echo -e "Done.\n" # need to touch the dir because the timestamp in the tarball # is older than that of the tarball :) build/docbook-xsl: build/docbook-xsl-1.71.0.tar.gz @echo -e "\n=== Un-taring docbook-xsl\n" @cd build &amp;&amp; tar xzf docbook-xsl-1.71.0.tar.gz &amp;&amp; touch docbook-xsl-1.71.0 </code></pre> <p>to automate the production of the above mentioned file outputs.</p> <p>I prefer to use a nix approach to the scripting just because the toolset is more easy to find and use, not to mention easier to chain.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload