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:
- localize_quotes.lua
- resolve_internal_links.part.lua
- link_headings.lua
...

View File

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

View File

@ -4,25 +4,25 @@ os.setlocale("C")
local Inlines = pandoc.Inlines
return {
{ Link = function(link)
{ Link = function(l)
-- early return for external links
if link.target:find("^https?%:%/%/") then return end
if link.target:find("^mailto%:") then return end
if l.target:find("^https?%:%/%/") 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
if not fp then return end
local f = io.open(fp)
-- 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)
link.content = ""
link.target = ("%s.html#%s"):format(slug, anchor)
l.content = ""
l.target = ("%s.html#%s"):format(slug, anchor)
return Inlines({ internal_link, link })
return Inlines({ internal_link, l })
end }
}

View File

@ -9,20 +9,20 @@ return {
{ Meta = function(meta)
page_slug = meta["slug"]
end },
{ Link = function(link)
{ Link = function(l)
-- early return for external links
if link.target:find("^https?%:%/%/") then return end
if link.target:find("^mailto%:") then return end
if l.target:find("^https?%:%/%/") 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
if not fp then return end
local f = io.open(fp)
-- 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)
return link
l.target = ("%s.html#%s%s"):format(page_slug, slug, anchor)
return l
end }
}

View File

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