bin/lecdown @ 1d6b60fde7f1

more
author Steve Losh <steve@stevelosh.com>
date Tue, 23 Aug 2016 22:48:19 +0000
parents (none)
children 30edc2f560bf
#!/usr/bin/env bash

set -e

echo "<!DOCTYPE html><html><head>"

cat <<EOF
<meta charset="utf-8" />
<style media="screen" type="text/css">

body {
    margin: 50px auto 300px;
    width: 600px;
    font: 24px/1.4 "Palatino Linotype";
    color: #222;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Gill Sans";
}

code {
    font: 20px Menlo;
}

p code {
    border: 1px solid #ccc;
    background: #fdfdfd;
    padding: 1px 5px;
}

pre {
    border: 1px solid #ddd;
    background: #fdfdfd;
    padding: 10px 10px;
}

a, a:visited {
    color: #6A1D18;
    text-decoration: none;
}

</style>
EOF


cat <<EOF
    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
EOF

cat <<EOF
<script>
MathJax.Hub.Config({
  tex2jax: {
    inlineMath: [[',,',',,'], ['\\\\(','\\\\)']],
    processEscapes: true
  }
});

</script>
EOF

echo "</head><body>"

pandoc --from markdown --to html $*

echo "</body></html>"