Fix code formatting bug in the ncdc man page
This commit is contained in:
parent
6691355ace
commit
374d30f092
2 changed files with 6 additions and 4 deletions
8
Makefile
8
Makefile
|
|
@ -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
|
||||
|
|
|
|||
2
mkpod.pl
2
mkpod.pl
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue