Improve formatting of mdoc
https://github.com/jgm/pandoc/issues/9201 has been fixed, so we can now go through 'man' instead.
This commit is contained in:
parent
c39079c121
commit
660466e13b
2 changed files with 8 additions and 8 deletions
14
Makefile
14
Makefile
|
|
@ -141,16 +141,16 @@ ${CHANGES_MD}: dat/%.md: dat/%.log mkchangelog.pl
|
|||
|
||||
|
||||
# pandoc doesn't support mdoc directly. Going through a `mandoc -T man` tends
|
||||
# to generate nicer formatting, but runs into another issue:
|
||||
# https://github.com/jgm/pandoc/issues/9201
|
||||
# We'll have to settle for the quote-abusing `mandoc -T markdown` with some
|
||||
# post-processing and fixups.
|
||||
# to generate nicer formatting than `mandoc -T markdown`, though any links
|
||||
# appear to get lost. Going through `mandoc -T html` is also an option, but
|
||||
# pandoc makes quite a mess of that.
|
||||
${MDOC_MD}: dat/%.md: dat/%.mdoc
|
||||
@echo "MDOC $*"
|
||||
@(echo "% ${shell for i in ${PAGES}; do case "$$i" in "$*.mdoc "*) echo "$$i" | sed -E 's/[^ ]+ +[^ ]+ +//';; esac; done}";\
|
||||
mandoc -T markdown "$<" | \
|
||||
tail -n +2 | head -n -2 | \
|
||||
sed -E -e 's/--/\\--/g' -e 's/-/-/g' -e 's/(^|[ ,.])([a-zA-Z0-9-]+)\(([1-8])\)/\1[\2(\3)](https:\/\/manned.org\/man\/\2.\3)/g' \
|
||||
mandoc -T man "$<" |\
|
||||
pandoc -f man -t markdown |\
|
||||
sed -E -e 's/(^|[ ,.])([a-zA-Z0-9-]+)\(([1-8])\)/\1[\2(\3)](https:\/\/manned.org\/man\/\2.\3)/g' \
|
||||
-e 's/\*\*(https:[^[:space:]]+)\*\*/[\1](\1)/g' \
|
||||
) >"$@"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,5 +8,5 @@ Build-time:
|
|||
- curl
|
||||
- Perl (+ Pod::Simple)
|
||||
- TUWF
|
||||
- pandoc
|
||||
- pandoc (>= 3.1.10 for better man page formatting)
|
||||
- mandoc
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue