general-purpose md2html

Wed, 28 Jul 2021 01:18:55 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Wed, 28 Jul 2021 01:18:55 -0500
changeset 929
97b6cf0bd601
parent 928
9674b3a2ad41
child 930
6edfe4c6ebe5

general-purpose md2html

.pandoc/templates/md2html.html5 file | annotate | diff | comparison | revisions
bin/md2html file | annotate | diff | comparison | revisions
new file mode 100644
--- /dev/null
+++ b/.pandoc/templates/md2html.html5
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html$if(lang)$ lang="$lang$"$endif$$if(dir)$ dir="$dir$"$endif$>
+  <head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
+    <title>$if(docmeta-title)$$docmeta-title$$else$$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$$endif$</title>
+    <style type="text/css">
+      nav {
+        float: right;
+        max-width: 25%;
+        font-size: 90%;
+        white-space: nowrap;
+        hyphens: none;
+      }
+      nav ul {
+        list-style: none;
+      }
+      body {
+        font-family: sans-serif;
+        line-height: 1.2em;
+        max-width: 62em;
+        margin: 5em;
+        background: floralwhite;
+      }
+      article ul {
+        margin-right: 8em;
+      }
+      blockquote, div.sourceCode {
+        margin:0 0 0 .8ex;
+        border-left:1px #ccc solid;
+        padding-left:1ex;
+      }
+      a, a:visited {
+        color: blue;
+        text-decoration-style: dotted;
+      }
+      $if(quotes)$q { quotes: "“" "”" "‘" "’"; } $endif$
+      $if(highlighting-css)$ $highlighting-css$ $endif$
+    </style>
+  </head>
+  <body>
+$if(toc)$
+<nav id="$idprefix$TOC">
+$toc$
+</nav>
+$endif$
+<article>
+$body$
+</article>
+  </body>
+</html>
new file mode 100755
--- /dev/null
+++ b/bin/md2html
@@ -0,0 +1,11 @@
+#!/bin/sh
+exec pandoc \
+  --quiet \
+  --standalone \
+  -f markdown+smart \
+  -t html5 \
+  --toc \
+  --toc-depth=5 \
+  --self-contained \
+  --template=md2html \
+   $*

mercurial