Browse code

Add pandoc default HTML5 template

Generated with `pandoc -D html5`.

Robert Cranston authored on 28/09/2019 12:15:25
Showing 2 changed files

... ...
@@ -3,10 +3,30 @@
3 3
 A single-file [pandoc][] HTML5 [template][] using [Bootstrap 4.3][] and
4 4
 [Tocbot][].
5 5
 
6
+Place [`bootstrap-toc.html`](bootstrap-toc.html) in the `templates` directory
7
+(optionally in a subdirectory) in your pandoc [`--data-dir`][] (which defaults
8
+to `$XDG_DATA_HOME/pandoc`, `$HOME/.local/share/pandoc` or `$HOME/.pandoc` on
9
+Unix-like systems) and invoke pandoc with [`--template`][]`=bootstrap-toc.html`
10
+( [`--template`][] implies [`--standalone`][]).
11
+
12
+To make this the default HTML template, symlink (or rename)
13
+`bootstrap-toc.html` to `$data_dir/default.html` (and
14
+`$data_dir/default.html5`). To enable templating without explicitly specifying
15
+one you need to use [`--standalone`][].
16
+
17
+Options you probably want include [`--toc`][], and perhaps
18
+[`--toc-depth`][]`=6`. Another nice option is [`--mathjax`][].
19
+
6 20
 [pandoc]: https://pandoc.org
7 21
 [template]: https://pandoc.org/MANUAL.html#templates
8 22
 [Bootstrap 4.3]: https://getbootstrap.com/docs/4.3
9 23
 [Tocbot]: https://tscanlin.github.io/tocbot
24
+[`--data-dir`]: https://pandoc.org/MANUAL.html#option--data-dir
25
+[`--template`]: https://pandoc.org/MANUAL.html#option--template
26
+[`--standalone`]: https://pandoc.org/MANUAL.html#option--standalone
27
+[`--toc`]: https://pandoc.org/MANUAL.html#option--toc
28
+[`--toc-depth`]: https://pandoc.org/MANUAL.html#option--toc-depth
29
+[`--mathjax`]: https://pandoc.org/MANUAL.html#option--mathjax
10 30
 
11 31
 ## License
12 32
 
13 33
new file mode 100644
... ...
@@ -0,0 +1,67 @@
1
+<!DOCTYPE html>
2
+<html$if(lang)$ lang="$lang$"$endif$$if(dir)$ dir="$dir$"$endif$>
3
+<head>
4
+  <meta charset="utf-8">
5
+  <meta name="generator" content="pandoc">
6
+  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
7
+$for(author-meta)$
8
+  <meta name="author" content="$author-meta$">
9
+$endfor$
10
+$if(date-meta)$
11
+  <meta name="dcterms.date" content="$date-meta$">
12
+$endif$
13
+$if(keywords)$
14
+  <meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$">
15
+$endif$
16
+  <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>
17
+  <style type="text/css">code{white-space: pre;}</style>
18
+$if(quotes)$
19
+  <style type="text/css">q { quotes: "“" "”" "‘" "’"; }</style>
20
+$endif$
21
+$if(highlighting-css)$
22
+  <style type="text/css">
23
+$highlighting-css$
24
+  </style>
25
+$endif$
26
+$for(css)$
27
+  <link rel="stylesheet" href="$css$">
28
+$endfor$
29
+$if(math)$
30
+  $math$
31
+$endif$
32
+  <!--[if lt IE 9]>
33
+    <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
34
+  <![endif]-->
35
+$for(header-includes)$
36
+  $header-includes$
37
+$endfor$
38
+</head>
39
+<body>
40
+$for(include-before)$
41
+$include-before$
42
+$endfor$
43
+$if(title)$
44
+<header>
45
+<h1 class="title">$title$</h1>
46
+$if(subtitle)$
47
+<p class="subtitle">$subtitle$</p>
48
+$endif$
49
+$for(author)$
50
+<p class="author">$author$</p>
51
+$endfor$
52
+$if(date)$
53
+<p class="date">$date$</p>
54
+$endif$
55
+</header>
56
+$endif$
57
+$if(toc)$
58
+<nav id="$idprefix$TOC">
59
+$toc$
60
+</nav>
61
+$endif$
62
+$body$
63
+$for(include-after)$
64
+$include-after$
65
+$endfor$
66
+</body>
67
+</html>