[vala/wip/manual: 20/21] manual: Add pdf target that uses WeasyPrint
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/manual: 20/21] manual: Add pdf target that uses WeasyPrint
- Date: Sat, 11 Mar 2017 23:48:56 +0000 (UTC)
commit 8a82eff16e8091d571e1e03403873ec55b20ad1f
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 36ced73..7b7bc91 100644
--- a/doc/manual/.gitignore
+++ b/doc/manual/.gitignore
@@ -1,4 +1,5 @@
version.xml
devhelp/
html/
+pdf/
print/
diff --git a/doc/manual/Makefile.am b/doc/manual/Makefile.am
index f933af0..2919943 100644
--- a/doc/manual/Makefile.am
+++ b/doc/manual/Makefile.am
@@ -53,10 +53,24 @@ print: manual.xml version.xml common.xsl print.xsl default.css
@cp $(srcdir)/default.css $@
@touch $@
+if HAVE_WEASYPRINT
+pdf: print
+ @$(MKDIR_P) $@
+ @echo Generating PDF version of manual, this may take some time...
+ $(AM_V_GEN)$(WEASYPRINT) \
+ $(builddir)/print/index.html \
+ $@/manual.pdf
+ @touch $@
+else
+pdf:
+ @echo Install weasyprint and re-run ./autogen.sh to generate a PDF of the Vala manual
+endif
+
mostlyclean-local:
rm -rf devhelp
rm -rf html
rm -rf print
+ rm -rf pdf
CLEANFILES = \
version.xml \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]