Manual: Initial revision
[pulseview.git] / manual / generate
diff --git a/manual/generate b/manual/generate
new file mode 100755 (executable)
index 0000000..19d1ca3
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+##
+## This file is part of the PulseView project.
+##
+## Copyright (C) 2018 Soeren Apel <soeren@apelpie.net>
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, see <http://www.gnu.org/licenses/>.
+##
+
+echo "Trying to generate HTML output..."
+asciidoctor -a stylesheet=readthedocs.css -a stylesdir=asciidoctor-stylesheet-factory/stylesheets -a toc=left pulseview_manual.txt || exit
+echo " --> pulseview_manual.html OK"
+
+# Run asciidoctor-pdf only if it can be found in $PATH
+#echo "Trying to generate PDF output..."
+#type asciidoctor-pdf && asciidoctor-pdf -a stylesheet=readthedocs.css -a stylesdir=asciidoctor-stylesheet-factory/stylesheets pulseview_manual.txt || exit
+#echo " --> pulseview_manual.pdf OK"