Skip to content

Commit

Permalink
Fix gemini links
Browse files Browse the repository at this point in the history
  • Loading branch information
prodrigestivill committed Jul 10, 2024
1 parent acac6b2 commit 8fe946a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CHAPTERS=$(shell grep -Eoi '\([^\)]+' src/SUMMARY.md | sed -e 's,^.,src/,')

PANDOC_OPTIONS+=-f markdown+rebase_relative_paths
PANDOC_OPTIONS+=--metadata-file=metadata.yaml
PANDOC_OPTIONS+=--lua-filter=pandoc-filter.lua

# PDF: Add cover and hide title text page
PANDOC_PDF_OPTIONS+=-B cover.tex -V title:
Expand All @@ -28,7 +29,6 @@ epub:

texi:
pandoc $(CHAPTERS) $(PANDOC_OPTIONS) -o r2book.texi
sed -i -E 's,@uref\{[0-9a-z/_-]+gemini://,@uref\{gemini://,gI' r2book.texi # fix gemini link

info: texi
rm -f r2book.info r2book.info.gz
Expand Down
10 changes: 10 additions & 0 deletions pandoc-filter.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- Fix gemini:// links
-- Requiered until this PR gets merged
-- https://github.com/jgm/pandoc/pull/9968
function Link(el)
protopos = string.find(el.target, "/gemini://")
if protopos then
el.target = string.sub(el.target, protopos + 1);
end
return el
end

0 comments on commit 8fe946a

Please sign in to comment.