aboutsummaryrefslogtreecommitdiff
path: root/mdwn2man
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-03-15 04:40:32 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-03-15 04:40:32 +0000
commita1a7019f276902c53aad2b2cb71e74f6e974fa05 (patch)
tree6f89260f5692410e62510d7397ccbe82e6f9e677 /mdwn2man
parent1186094987d8ddb725cf4d69fa357741117d7c11 (diff)
downloadikiwiki-a1a7019f276902c53aad2b2cb71e74f6e974fa05.tar
ikiwiki-a1a7019f276902c53aad2b2cb71e74f6e974fa05.tar.gz
man page generation
Diffstat (limited to 'mdwn2man')
-rwxr-xr-xmdwn2man35
1 files changed, 35 insertions, 0 deletions
diff --git a/mdwn2man b/mdwn2man
new file mode 100755
index 000000000..13b1b84a8
--- /dev/null
+++ b/mdwn2man
@@ -0,0 +1,35 @@
+#!/usr/bin/perl
+# Warning: hack
+
+print ".TH ikiwiki 1\n";
+
+while (<>) {
+ s/^#\s/.SH /;
+ s/^\s+//;
+ s/^Warning:.*//g;
+ s/^$/.PP\n/;
+ s/\[\[//g;
+ s/\]\]//g;
+ s/\`//g;
+ s/^\*\s+(.*)/.IP "$1"/;
+ next if $_ eq ".PP\n" && $skippara;
+ if (/^.IP /) {
+ $inlist=1;
+ $spippara=0;
+ }
+ elsif (/.SH/) {
+ $skippara=0;
+ $inlist=0;
+ }
+ elsif (/^\./) {
+ $skippara=1;
+ }
+ else {
+ $skippara=0;
+ }
+ if ($inlist && $_ eq ".PP\n") {
+ $_=".IP\n";
+ }
+
+ print $_;
+}