diff --git a/Makefile b/Makefile index f0cf533..3be3483 100644 --- a/Makefile +++ b/Makefile @@ -20,10 +20,14 @@ artifacts/deps.pdf: deps.ps Makefile mkdir -p $$(dirname $@) ps2pdf $< $@ -artifacts/index.html: Makefile +artifacts/index.html: doc-src/index.html Makefile mkdir -p $$(dirname $@) cp doc-src/index.html $@ -artifacts/references/index.html: +artifacts/references/index.html: references.md artifacts/references/style.css Makefile mkdir -p $$(dirname $@) - markdown references.md > $@ + doc-src/markdown2html.sh $< "References" > $@ + +artifacts/references/style.css: doc-src/style.css Makefile + mkdir -p $$(dirname $@) + cp $< $@ diff --git a/doc-src/markdown2html.sh b/doc-src/markdown2html.sh new file mode 100755 index 0000000..e12c4fa --- /dev/null +++ b/doc-src/markdown2html.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +if test $# -ne 2; then + printf %s\\n 'Usage: path/to/markdown2html.sh file.md "Page title"' + exit 1 +fi + +cat < + + + + $2 + + + +EOF +markdown "$1" | sed -e 's/^/ /' +cat <<'EOF' + + +EOF diff --git a/doc-src/style.css b/doc-src/style.css new file mode 100644 index 0000000..18c93c5 --- /dev/null +++ b/doc-src/style.css @@ -0,0 +1,94 @@ +html { + background: #eee; + padding: 0 .5em; +} + +body { + background: white; + border: thick solid #ddd; + border-radius: 2em; + padding: 0.5em 2em 1.5em; + max-width: 40em; + margin: 2em auto; + font-family: Helvetica,Arial,sans-serif; + font-size: 120%; + line-height: 1.3em; + color: #333; +} + +h1 { + color: #222; +} + +code { + color: #04c; + background: #eee; + padding: 0.1em 0.3em; +} + +input, select { + padding: 0.3em !important; +} + +pre em { + color: red; + font-style: normal; +} + +kbd { + color: #444; + background-color: aliceblue; + border: thin solid gray; + border-radius: .5ex; + padding-left: .5ex; + padding-right: .5ex; +} + +pre kbd { + color: #04c; + border: none; + border-radius: 0; + padding-left: initial; + padding-right: initial; +} + +pre { + overflow: auto; + background: #eee; + border: thin solid #ccc; + padding: .5em; + border-radius: .5em; +} + +hr { + margin: 1em 25%; + height: .35ex; + color: #aaa; + background-color: #aaa; + border: none; + border-radius: .175ex; +} + +/* TODO: use a technique like tinytypo's to change the quotes based on the language? + * https://github.com/tetue/tinytypo/blob/5f7411746c8c4d634ac8cd14c730b86f4ffd1813/css/typo.css#L397 + */ +blockquote { + border-left: 0.85ex solid #ccc; + padding: 0.8ex 1ex; + background: #f0f0f0; + margin: 1em 2em; +} + +/* An