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



commit 6ccb53de05b3a8f1bf714457e358314db5ceab99
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 |   14 ++++++++++++++
 3 files changed, 18 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 8b1ac8b..6c0680d 100644
--- a/doc/manual/Makefile.am
+++ b/doc/manual/Makefile.am
@@ -51,12 +51,26 @@ 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
+       @$(MKDIR_P) $@
+       @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]