forked from tildeverse/zine
permalinks and make non-h1 headers smaller
This commit is contained in:
parent
8e95deabfa
commit
892f13da8e
16
Makefile
16
Makefile
|
@ -1,12 +1,12 @@
|
||||||
ISSUES != find issues -type d
|
ISSUES != find issues -type d
|
||||||
DEST_PDF_FILES := $(ISSUES:issues/%=issue-%.pdf)
|
DEST_PDF_FILES := $(ISSUES:issues/%=dist/issue-%.pdf)
|
||||||
DEST_HTML_FILES := $(ISSUES:issues/%=issue-%.html)
|
DEST_HTML_FILES := $(ISSUES:issues/%=dist/issue-%.html)
|
||||||
|
|
||||||
PANDOC != command -v pandoc 2> /dev/null
|
PANDOC != command -v pandoc 2> /dev/null
|
||||||
|
|
||||||
all: $(DEST_PDF_FILES) $(DEST_HTML_FILES)
|
all: $(DEST_PDF_FILES) $(DEST_HTML_FILES)
|
||||||
|
|
||||||
issue-%.pdf: issues/%
|
dist/issue-%.pdf: issues/%
|
||||||
$(PANDOC) \
|
$(PANDOC) \
|
||||||
--file-scope \
|
--file-scope \
|
||||||
--from markdown \
|
--from markdown \
|
||||||
|
@ -18,22 +18,24 @@ issue-%.pdf: issues/%
|
||||||
--output $@ \
|
--output $@ \
|
||||||
$</*.md
|
$</*.md
|
||||||
|
|
||||||
issue-%.html: issues/%
|
dist/issue-%.html: issues/%
|
||||||
$(PANDOC) \
|
$(PANDOC) \
|
||||||
--file-scope \
|
--file-scope \
|
||||||
--from markdown \
|
--from markdown \
|
||||||
--to html \
|
--to html \
|
||||||
--standalone \
|
--standalone \
|
||||||
--table-of-contents \
|
--table-of-contents \
|
||||||
|
--lua-filter header-permalinks.lua \
|
||||||
|
--lua-filter increase-header-levels.lua \
|
||||||
--metadata title:"tildeverse zine $@" \
|
--metadata title:"tildeverse zine $@" \
|
||||||
--metadata include-before:"<div class=\"container\">" \
|
--variable include-before:"<div class=\"container\">" \
|
||||||
--metadata include-after:"</div>" \
|
--variable include-after:"</div>" \
|
||||||
--css https://tilde.team/css/hacker.css \
|
--css https://tilde.team/css/hacker.css \
|
||||||
--output $@ \
|
--output $@ \
|
||||||
$</*.md
|
$</*.md
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm *.html *.pdf
|
rm dist/*.html dist/*.pdf
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
function Header(elem)
|
||||||
|
table.insert(elem.content, pandoc.Space())
|
||||||
|
table.insert(elem.content, pandoc.Link("§", "#" .. elem.identifier))
|
||||||
|
return elem
|
||||||
|
end
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
function Header(elem)
|
||||||
|
if elem.level > 1 then
|
||||||
|
elem.level = elem.level + 1
|
||||||
|
end
|
||||||
|
return elem
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in New Issue