update `pandoc` data dir
parent
c098307fd7
commit
5f5f3e1463
|
@ -8,4 +8,5 @@ to: html5
|
|||
filters:
|
||||
- localize_quotes.lua
|
||||
- resolve_internal_links.part.lua
|
||||
- link_headings.lua
|
||||
...
|
||||
|
|
|
@ -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
|
||||
...
|
||||
|
|
|
@ -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 }
|
||||
}
|
||||
|
|
|
@ -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 }
|
||||
}
|
||||
|
|
|
@ -44,6 +44,11 @@ $abstract$
|
|||
</div>
|
||||
$endif$
|
||||
$body$
|
||||
$if(date)$
|
||||
<footer>
|
||||
<p>$date$</p>
|
||||
</footer>
|
||||
$endif$
|
||||
</article>
|
||||
<article id="recto">
|
||||
$for(parts)$
|
||||
|
|
Loading…
Reference in New Issue