summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2015-12-29 19:16:08 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2015-12-30 22:22:33 +0000
commitf278fdac59471711dd4753c73e795c1cd4683c13 (patch)
tree19f9ec6a404550fb2a0585b6d3875536db203f08
parent3763beb4898b89eb7021fcd4427d2944cd9bc575 (diff)
downloadswig-f278fdac59471711dd4753c73e795c1cd4683c13.tar.gz
Replace pdf documentation generation tool with wkhtmltopdf from htmldoc
htmldoc does not seem to be generating pdfs properly any more (on Ubuntu 14.04). It has been replaced with wkhtmltopdf which is better as it supports css and so the patched version of htmldoc with the simple css support is no longer required. wkhtmldoc does have have a few problems though which have been addressed in prior commits: - <H1><a name="X"></a>Text</H1> style links need changing to: <H1><a name="X">Text</a></H1> - tabs in <pre> elements should be expanded to 8 spaces by default, but are expanded to just one space and css expand-tab is not recognised. The <pre> <tt> <code> elements do not always select a fixed-width font - try installing a Courier font.
-rw-r--r--Doc/Manual/Makefile28
1 files changed, 15 insertions, 13 deletions
diff --git a/Doc/Manual/Makefile b/Doc/Manual/Makefile
index 7347691cd..2c90e91e5 100644
--- a/Doc/Manual/Makefile
+++ b/Doc/Manual/Makefile
@@ -26,25 +26,27 @@ maketoc:
CCache.html: ../../CCache/ccache.yo
yodl2html -o CCache.html ../../CCache/ccache.yo
+# Tabs in the html files will stop the build as wkhtmltopdf does not expand them correctly - replace them with the appropriate number of tabs
# Use htmltidy to warn about some HTML errors. Note that it is not used to clean/tidy the HTML,
# it is just used as a primitive HTML checker.
# CCache.html is generated by yodl2html and has a few insignificant problems, so we don't put it through tidy
check:
- tidy -errors --gnu-emacs yes -quiet index.html
- tidy -errors --gnu-emacs yes -quiet Sections.html
- all=`sed '/^#/d' chapters | grep -v CCache.html`; for a in $$all; do tidy -errors --gnu-emacs yes -quiet $$a; done;
-
-generate: swightml.book swigpdf.book
+ all="index.html Sections.html `sed '/^#/d' chapters | grep -v CCache.html`" && for a in $$all; do echo "Check for tabs $$a" && if grep -P '\t' $$a; then echo "Please delete the tabs from the lines above" && exit 1; fi; done && for a in $$all; do echo "HTML tidy check $$a" && tidy -errors --gnu-emacs yes -quiet $$a; done;
+
+# Note wkhtmltopdf limitations for generating pdf docs:
+# 1) <H1><a name="X"></a>Text</H1> style links don't work and need changing to
+# <H1><a name="X">Text</a></H1>
+# 2) Tabs in <pre> elements should be expanded to 8 spaces by default, but
+# are expanded to just one space and css tab-size is not working.
+# 3) <pre> <tt> <code> elements do not always select a fixed-width font - try installing the
+# Courier font to fix.
+generate: SWIGDocumentation.html
+ wkhtmltopdf --margin-top 20mm --margin-bottom 20mm --margin-left 10mm --margin-right 10mm --header-font-size 6 --footer-font-size 6 --header-spacing 6 --footer-spacing 6 --header-center '[doctitle]' --footer-left '[subsection]' --footer-right '[page]' SWIGDocumentation.html SWIGDocumentation.pdf
+
+SWIGDocumentation.html: swightml.book
htmldoc --batch swightml.book || true
- htmldoc --batch swigpdf.book || true
python fixstyle.py SWIGDocumentation.html
-swigpdf.book: chapters Sections.html
- echo "#HTMLDOC 1.8.24" > swigpdf.book
- echo -t pdf13 -f SWIGDocumentation.pdf $(HTMLDOC_OPTIONS) --stylesheet style.css >> swigpdf.book
- echo "Sections.html" >> swigpdf.book
- cat chapters >> swigpdf.book
-
swightml.book: chapters Sections.html
echo "#HTMLDOC 1.8.24" > swightml.book
echo -t html -f SWIGDocumentation.html $(HTMLDOC_OPTIONS) >> swightml.book
@@ -53,9 +55,9 @@ swightml.book: chapters Sections.html
maintainer-clean: clean-baks
rm -f swightml.book
- rm -f swigpdf.book
rm -f SWIGDocumentation.html
rm -f SWIGDocumentation.pdf
+ rm -rf linkchecker-tmp
clean-baks:
rm -f *.bak