Drop mandoc, pandoc can read mdoc now; styling; guestbook
This commit is contained in:
parent
76b8f42f1d
commit
af1f4c0dd2
7 changed files with 68 additions and 33 deletions
17
mdocproc.pl
Executable file
17
mdocproc.pl
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
use v5.36;
|
||||
|
||||
my $insyn = 0;
|
||||
while (<>) {
|
||||
$insyn = /^# SYNOPSIS$/ if /^#/;
|
||||
if ($insyn) {
|
||||
# Improve styling of synopsis
|
||||
s/\\\[`/<span class="synopt">[`/g;
|
||||
s/\\]/]<\/span>/g;
|
||||
} else {
|
||||
# Turn man page references into links
|
||||
s{\[([a-zA-Z0-9-]+)\(([1-8])\)\]\{\.Xr\}}{[$1($2)](https://manned.org/man/$1.$2)}g;
|
||||
}
|
||||
print;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue