update `pandoc` data dir

master
urosm 2024-06-26 16:02:01 +02:00
parent c098307fd7
commit 5f5f3e1463
5 changed files with 24 additions and 17 deletions

View File

@ -8,4 +8,5 @@ to: html5
filters: filters:
- localize_quotes.lua - localize_quotes.lua
- resolve_internal_links.part.lua - resolve_internal_links.part.lua
- link_headings.lua
... ...

View File

@ -3,11 +3,12 @@ from: markdown
toc: true toc: true
citeproc: true citeproc: true
csl: chicago-fullnote-sl csl: chicago-fullnote-sl
reference-location: section
template: bavbavhaus.net.html5 template: bavbavhaus.net.html5
to: html5 to: html5
filters: filters:
- localize_quotes.lua - localize_quotes.lua
- collect_internal_linked.lua - collect_internal_linked.lua
- resolve_internal_links.lua - resolve_internal_links.lua
- link_headings.lua
- current_date.lua
... ...

View File

@ -4,25 +4,25 @@ os.setlocale("C")
local Inlines = pandoc.Inlines local Inlines = pandoc.Inlines
return { return {
{ Link = function(link) { Link = function(l)
-- early return for external links -- early return for external links
if link.target:find("^https?%:%/%/") then return end if l.target:find("^https?%:%/%/") then return end
if link.target:find("^mailto%:") then return end if l.target:find("^mailto%:") then return end
local fp, slug, anchor = link.target:match("^((.+)%.md)#?(.*)$") local fp, slug, anchor = l.target:match("^((.+)%.md)#?(.*)$")
-- early return for non markdown files -- early return for non markdown files
if not fp then return end if not fp then return end
local f = io.open(fp) local f = io.open(fp)
-- early return for broken internal links -- early return for broken internal links
if f == nil then return link.content else f:close() end -- @todo maybe log broken internal links if f == nil then return l.content else f:close() end -- @todo maybe log broken internal links
local internal_link = link:clone() local internal_link = l:clone()
internal_link.target = ("#%s%s"):format(slug, anchor) internal_link.target = ("#%s%s"):format(slug, anchor)
link.content = "" l.content = ""
link.target = ("%s.html#%s"):format(slug, anchor) l.target = ("%s.html#%s"):format(slug, anchor)
return Inlines({ internal_link, link }) return Inlines({ internal_link, l })
end } end }
} }

View File

@ -9,20 +9,20 @@ return {
{ Meta = function(meta) { Meta = function(meta)
page_slug = meta["slug"] page_slug = meta["slug"]
end }, end },
{ Link = function(link) { Link = function(l)
-- early return for external links -- early return for external links
if link.target:find("^https?%:%/%/") then return end if l.target:find("^https?%:%/%/") then return end
if link.target:find("^mailto%:") then return end if l.target:find("^mailto%:") then return end
local fp, slug, anchor = link.target:match("^((.+)%.md)#?(.*)$") local fp, slug, anchor = l.target:match("^((.+)%.md)#?(.*)$")
-- early return for non markdown files -- early return for non markdown files
if not fp then return end if not fp then return end
local f = io.open(fp) local f = io.open(fp)
-- early return for broken internal links -- early return for broken internal links
if f == nil then return link.content else f:close() end -- @todo maybe log broken internal links if f == nil then return l.content else f:close() end -- @todo maybe log broken internal links
link.target = ("%s.html#%s%s"):format(page_slug, slug, anchor) l.target = ("%s.html#%s%s"):format(page_slug, slug, anchor)
return link return l
end } end }
} }

View File

@ -44,6 +44,11 @@ $abstract$
</div> </div>
$endif$ $endif$
$body$ $body$
$if(date)$
<footer>
<p>$date$</p>
</footer>
$endif$
</article> </article>
<article id="recto"> <article id="recto">
$for(parts)$ $for(parts)$