summary refs log tree commit diff
path: root/doc/Makefile
diff options
context:
space:
mode:
authorNaïm Favier <n@monade.li>2023-01-02 14:00:58 +0100
committerNaïm Favier <n@monade.li>2023-01-02 14:11:22 +0100
commita8d4cf149cda4f82145291cc9a6819a9baa3951e (patch)
treea92d5a3a9c5bff6a5969561910113d9f8f88e6b6 /doc/Makefile
parent5a9a3353342fc2a964c58f91ef8cbb19585c3af8 (diff)
downloadnixpkgs-a8d4cf149cda4f82145291cc9a6819a9baa3951e.tar
nixpkgs-a8d4cf149cda4f82145291cc9a6819a9baa3951e.tar.gz
nixpkgs-a8d4cf149cda4f82145291cc9a6819a9baa3951e.tar.bz2
nixpkgs-a8d4cf149cda4f82145291cc9a6819a9baa3951e.tar.lz
nixpkgs-a8d4cf149cda4f82145291cc9a6819a9baa3951e.tar.xz
nixpkgs-a8d4cf149cda4f82145291cc9a6819a9baa3951e.tar.zst
nixpkgs-a8d4cf149cda4f82145291cc9a6819a9baa3951e.zip
doc: separate manpage URLs from the Pandoc filter
Move the manpage-to-URL mapping to `doc/manpage-urls.json` so that we can
reuse that file elsewhere, and generate the `link-manpages.lua` filter from
that file.

Also modify the Pandoc filter so that it doesn't wrap manpages that are
already inside a link.

Keeping a Lua filter is essential for speed: a Python filter would
increase the runtime `md-to-db.sh` from ~20s to ~30s (but Python is not
to blame; marshalling Pandoc types to and from JSON is a costly operation).
Parsing in Lua seems tedious, so I went with the Nix way.
Diffstat (limited to 'doc/Makefile')
-rw-r--r--doc/Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/Makefile b/doc/Makefile
index f8d2d7248fa..1e54aef9bd1 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -11,7 +11,7 @@ pandoc_commonmark_enabled_extensions = +attributes+fenced_divs+footnotes+bracket
 pandoc_flags = --extract-media=$(pandoc_media_dir) \
 	--lua-filter=$(PANDOC_LUA_FILTERS_DIR)/diagram-generator.lua \
 	--lua-filter=build-aux/pandoc-filters/myst-reader/roles.lua \
-	--lua-filter=build-aux/pandoc-filters/link-unix-man-references.lua \
+	--lua-filter=$(PANDOC_LINK_MANPAGES_FILTER) \
 	--lua-filter=build-aux/pandoc-filters/docbook-writer/rst-roles.lua \
 	--lua-filter=build-aux/pandoc-filters/docbook-writer/labelless-link-is-xref.lua \
 	-f commonmark$(pandoc_commonmark_enabled_extensions)+smart