summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2018-02-01 15:08:33 +0100
committerFlorian Dold <florian.dold@gmail.com>2018-02-01 15:08:33 +0100
commit4db25c53116277c38ba1a916b88b8552ac90ebad (patch)
treee738f70d8a13b3d89f35ed9d16332ec830fb838e /doc
parenta2610d1b21d735b1363b33ca3ec4fe053b5e8a35 (diff)
downloadmerchant-4db25c53116277c38ba1a916b88b8552ac90ebad.tar.gz
merchant-4db25c53116277c38ba1a916b88b8552ac90ebad.tar.bz2
merchant-4db25c53116277c38ba1a916b88b8552ac90ebad.zip
fix doc build, include syntax highlighting
Diffstat (limited to 'doc')
-rw-r--r--doc/Makefile.am9
-rw-r--r--doc/manual.texi4
-rw-r--r--doc/syntax.texi44
3 files changed, 51 insertions, 6 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 94c0ef44..a755143e 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,13 +1,12 @@
all: manual.pdf manual.html
manual.pdf: arch.pdf manual.texi
- texi2pdf manual.texi
-manual.html: arch.jpg manual.texi
- makeinfo --html --no-split manual.texi
+manual.html: arch.png manual.texi
+
arch.pdf: arch.dot
dot -Tpdf arch.dot > arch.pdf
-arch.jpg: arch.dot
- dot -Tjpg arch.dot > arch.jpg
+arch.png: arch.dot
+ dot -Tpng arch.dot > arch.png
AM_MAKEINFOHTMLFLAGS = --no-split --css-ref=docstyle.css --css-ref=brown-paper.css
diff --git a/doc/manual.texi b/doc/manual.texi
index 861951d9..d8eeb0ec 100644
--- a/doc/manual.texi
+++ b/doc/manual.texi
@@ -4,6 +4,8 @@
@include version.texi
@settitle The GNU Taler merchant backend operator tutorial @value{VERSION}
+@include syntax.texi
+
@c Define a new index for options.
@defcodeindex op
@c Combine everything into one index (arbitrarily chosen to be the
@@ -159,7 +161,7 @@ The Taler software stack for a merchant consists of four main components:
The following image illustrates the various interactions of these
key components:
-@center @image{arch, 3in, 4in}
+@center @image{arch, 3in}
@cindex RESTful
Basically, the backend provides the cryptographic protocol support,
diff --git a/doc/syntax.texi b/doc/syntax.texi
new file mode 100644
index 00000000..8aca39d8
--- /dev/null
+++ b/doc/syntax.texi
@@ -0,0 +1,44 @@
+@c Syntax highlighting for texinfo's HTML output
+
+@html
+<script src="highlight.pack.js"></script>
+<script>
+var hls = [];
+var syntaxAuto = true;
+addEventListener("DOMContentLoaded", function() {
+ // Highlight blocks with fixed language
+ for (let x of hls) {
+ let next = x[0].nextElementSibling;
+ console.log("next", next);
+ let blocks = next.querySelectorAll("pre.example");
+ for (let i = 0; i < blocks.length; i++) {
+ blocks[i].classList.add("language-" + x[1]);
+ hljs.highlightBlock(blocks[i]);
+ }
+ }
+ // auto-detect other blocks if not disabled
+ if (syntaxAuto) {
+ let blocks = document.querySelectorAll("pre.example");
+ for (let i = 0; i < blocks.length; i++) {
+ hljs.highlightBlock(blocks[i]);
+ }
+ }
+});
+</script>
+@end html
+
+@macro setsyntax{lang}
+@html
+<script>
+hls.push([document.currentScript, "\lang\"]);
+</script>
+@end html
+@end macro
+
+@macro setsyntaxnoauto{}
+@html
+<script>
+syntaxAuto = false;
+</script>
+@end html
+@end macro