summaryrefslogtreecommitdiff
path: root/doc/syntax.texi
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-07-30 10:38:27 +0200
committerChristian Grothoff <christian@grothoff.org>2021-07-30 10:38:27 +0200
commit7e669bcf6b6336ec429da949bcb4aa456971dba2 (patch)
treed19912f950d1cac1c38b857b7d5bdaba2289544e /doc/syntax.texi
downloadanastasis-7e669bcf6b6336ec429da949bcb4aa456971dba2.tar.gz
anastasis-7e669bcf6b6336ec429da949bcb4aa456971dba2.tar.bz2
anastasis-7e669bcf6b6336ec429da949bcb4aa456971dba2.zip
folding history in preparation of GNU Anastasis v0.0.0 release
Diffstat (limited to 'doc/syntax.texi')
-rw-r--r--doc/syntax.texi44
1 files changed, 44 insertions, 0 deletions
diff --git a/doc/syntax.texi b/doc/syntax.texi
new file mode 100644
index 0000000..8aca39d
--- /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