diff options
author | Naïm Favier <n@monade.li> | 2023-01-02 14:00:58 +0100 |
---|---|---|
committer | Naïm Favier <n@monade.li> | 2023-01-02 14:11:22 +0100 |
commit | a8d4cf149cda4f82145291cc9a6819a9baa3951e (patch) | |
tree | a92d5a3a9c5bff6a5969561910113d9f8f88e6b6 /doc/contributing | |
parent | 5a9a3353342fc2a964c58f91ef8cbb19585c3af8 (diff) | |
download | nixlib-a8d4cf149cda4f82145291cc9a6819a9baa3951e.tar nixlib-a8d4cf149cda4f82145291cc9a6819a9baa3951e.tar.gz nixlib-a8d4cf149cda4f82145291cc9a6819a9baa3951e.tar.bz2 nixlib-a8d4cf149cda4f82145291cc9a6819a9baa3951e.tar.lz nixlib-a8d4cf149cda4f82145291cc9a6819a9baa3951e.tar.xz nixlib-a8d4cf149cda4f82145291cc9a6819a9baa3951e.tar.zst nixlib-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/contributing')
-rw-r--r-- | doc/contributing/contributing-to-documentation.chapter.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/contributing/contributing-to-documentation.chapter.md b/doc/contributing/contributing-to-documentation.chapter.md index 81482523cd0e..889b4114acca 100644 --- a/doc/contributing/contributing-to-documentation.chapter.md +++ b/doc/contributing/contributing-to-documentation.chapter.md @@ -53,7 +53,7 @@ Additional syntax extensions are available, though not all extensions can be use This syntax is taken from [MyST](https://myst-parser.readthedocs.io/en/latest/using/syntax.html#targets-and-cross-referencing). - []{#ssec-contributing-markup-inline-roles} - If you want to link to a man page, you can use `` {manpage}`nix.conf(5)` ``, which will turn into {manpage}`nix.conf(5)`. The references will turn into links when a mapping exists in {file}`doc/build-aux/pandoc-filters/link-unix-man-references.lua`. + If you want to link to a man page, you can use `` {manpage}`nix.conf(5)` ``, which will turn into {manpage}`nix.conf(5)`. The references will turn into links when a mapping exists in {file}`doc/manpage-urls.json`. A few markups for other kinds of literals are also available: |