make headings link to themselves
This commit is contained in:
5
Makefile
5
Makefile
@@ -15,10 +15,11 @@ html-cfp:
|
|||||||
|
|
||||||
MD2HTML=$(PANDOC) \
|
MD2HTML=$(PANDOC) \
|
||||||
-f markdown-smart-tex_math_dollars+autolink_bare_uris+wikilinks_title_after_pipe \
|
-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
|
# 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 "$@"
|
$(MD2HTML) --template page.tmpl "$<" -o "$@"
|
||||||
|
|
||||||
# regenerate html whenever an md file changes
|
# regenerate html whenever an md file changes
|
||||||
|
|||||||
7
headings.lua
Normal file
7
headings.lua
Normal file
@@ -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
|
||||||
@@ -10,6 +10,12 @@ h1, h2, h3, h4, h5, h6 {
|
|||||||
text-shadow: 1px 1px 2px white;
|
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 {
|
.tight p {
|
||||||
margin:0;
|
margin:0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user