diff --git a/Makefile b/Makefile index 3183d71..dc48854 100644 --- a/Makefile +++ b/Makefile @@ -15,10 +15,11 @@ html-cfp: MD2HTML=$(PANDOC) \ -f markdown-smart-tex_math_dollars+autolink_bare_uris+wikilinks_title_after_pipe \ - --lua-filter=wikilinks.lua + --lua-filter=wikilinks.lua \ + --lua-filter=headings.lua \ # generate html from a md file -out/%.html: src/%.md page.tmpl +out/%.html: src/%.md #page.tmpl wikilinks.lua headings.lua $(MD2HTML) --template page.tmpl "$<" -o "$@" # regenerate html whenever an md file changes diff --git a/headings.lua b/headings.lua new file mode 100644 index 0000000..45def9f --- /dev/null +++ b/headings.lua @@ -0,0 +1,7 @@ +-- Make all headings (except the page h1 added by page.tmpl) +-- clickable links to themselves, for easy bookmarking/linking. + +function Header(el) + el.content = pandoc.Link(el.content, '#' .. el.identifier) + return el +end diff --git a/out/css/site.css b/out/css/site.css index d62a9e0..102c56e 100644 --- a/out/css/site.css +++ b/out/css/site.css @@ -10,6 +10,12 @@ h1, h2, h3, h4, h5, h6 { text-shadow: 1px 1px 2px white; } +h1 a, h2 a, h3 a, h4 a, h5 a, h6 a, +h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover { + text-decoration:none; + color:inherit; +} + .tight p { margin:0; } diff --git a/page.tmpl b/page.tmpl index 3bfdf11..305b266 100644 --- a/page.tmpl +++ b/page.tmpl @@ -35,7 +35,7 @@