Fix code formatting bug in the ncdc man page

This commit is contained in:
Yorhel 2019-03-25 13:07:39 +01:00
parent 6691355ace
commit 374d30f092
2 changed files with 6 additions and 4 deletions

View file

@ -108,12 +108,14 @@ ${FETCH}: dat/%:
# There is a 'pod2markdown' program, but going through HTML with a little bit
# of Perl magic tends to give better results, if only because definition lists
# are properly converted this way and I have more control over links.
# The final pass through perl is to fix a pandoc bug where a code block as the
# first thing inside a definition does not survive a round-trip.
${POD_MD}: dat/%.md: dat/%.pod mkpod.pl
@echo "POD $*"
@cat "$<" | ./mkpod.pl |\
pandoc -f html -t markdown -s -o "$@" \
--metadata title="${shell for i in ${PAGES}; do case "$$i" in "$*.pod "*) echo "$$i" | sed -E 's/[^ ]+ +[^ ]+ +//';; esac; done}"
@rm -f pod2htmd.tmp pod2html.tmp
pandoc -f html -t markdown -s \
--metadata title="${shell for i in ${PAGES}; do case "$$i" in "$*.pod "*) echo "$$i" | sed -E 's/[^ ]+ +[^ ]+ +//';; esac; done}" |\
perl -e '$$/=undef; print (scalar(<>) =~ s/: ([^\s].*)\n ([^\s].*)/: $$1\n $$2/gr)' >"$@"
${CHANGES_MD}: dat/%.md: dat/%.log mkchangelog.pl

View file

@ -49,7 +49,7 @@ $p->parse_file(\*STDIN);
# Some post-processing to improve the pandoc-generated markdown
$html =~ s/^ //mg;
$html =~ s/<code> //g;
$html =~ s/<code> /<code>/g;
$html =~ s/<li><p>/<li>/g;
print $html;