X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/dd7a38147179a59bff9dffd824b265862aa1a59e..0a49070f91e31aef18fde6e709e5f78fd2a44e2b:/mdwn2man diff --git a/mdwn2man b/mdwn2man index 8c70c87c1..ad6d3c602 100755 --- a/mdwn2man +++ b/mdwn2man @@ -7,12 +7,18 @@ my $section=shift; print ".TH $prog $section\n"; while (<>) { - s{(\\?)\[\[([^\s\]]+)\]\]}{$1 ? "[[$2]]" : $2}eg; - s/^#\s/.SH /; - s/^\s+//; + s{(\\?)\[\[([^\s\|\]]+)(\|[^\s\]]+)?\]\]}{$1 ? "[[$2]]" : $2}eg; + s/\`//g; + s/^\s*\./\\&./g; + if (/^#\s/) { + s/^#\s/.SH /; + <>; # blank; + } + s/^[ \n]+//; + s/^\t/ /; + s/-/\\-/g; s/^Warning:.*//g; s/^$/.PP\n/; - s/\`//g; s/^\*\s+(.*)/.IP "$1"/; next if $_ eq ".PP\n" && $skippara; if (/^.IP /) {