[vala: 6/7] manual: Add pdf target that uses WeasyPrint



commit 8e70fb8a0e3af770d4e2d43df60408f611a179b3
Author: Alistair Thomas <astavale yahoo co uk>
Date:   Sat Mar 11 22:52:00 2017 +0000

    manual: Add pdf target that uses WeasyPrint

 configure.ac           |    3 +++
 doc/manual/.gitignore  |    1 +
 doc/manual/Makefile.am |   13 +++++++++++++
 3 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 030957e..14a771b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -97,6 +97,9 @@ AC_SUBST(GMODULE_LIBS)
 AC_PATH_PROG([XSLTPROC], [xsltproc], :)
 AM_CONDITIONAL(HAVE_XSLTPROC, test "$XSLTPROC" != :)
 
+AC_CHECK_PROG([WEASYPRINT], [weasyprint], [weasyprint])
+AM_CONDITIONAL(HAVE_WEASYPRINT, [test x$WEASYPRINT = xweasyprint])
+
 AC_CHECK_PROG([HELP2MAN], [help2man], [help2man])
 AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN = xhelp2man])
 
diff --git a/doc/manual/.gitignore b/doc/manual/.gitignore
index fbf57b2..f0b379c 100644
--- a/doc/manual/.gitignore
+++ b/doc/manual/.gitignore
@@ -1,4 +1,5 @@
 manual.html
+manual.pdf
 version.xml
 devhelp/
 html/
diff --git a/doc/manual/Makefile.am b/doc/manual/Makefile.am
index 1791d90..837291f 100644
--- a/doc/manual/Makefile.am
+++ b/doc/manual/Makefile.am
@@ -48,12 +48,25 @@ manual.html: manual.xml version.xml common.xsl print.xsl default.css
                $(srcdir)/print.xsl \
                $(srcdir)/manual.xml
 
+if HAVE_WEASYPRINT
+pdf: manual.pdf
+manual.pdf: manual.html default.css
+       @echo Generating PDF version of manual, this may take some time...
+       $(AM_V_GEN)$(WEASYPRINT) \
+               manual.html \
+               $@
+else
+pdf:
+       @echo Install weasyprint and re-run ./configure to generate a PDF of the Vala manual
+endif
+
 mostlyclean-local:
        rm -rf devhelp
        rm -rf html
 
 CLEANFILES = \
        manual.html \
+       manual.pdf \
        version.xml \
        $(NULL)
 


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