Просмотр исходного кода

Dont depend on my vim, depend on a perl script :)

Morten Brix Pedersen 24 лет назад
Родитель
Сommit
962a3c7324
2 измененных файлов с 27 добавлено и 5 удалено
  1. 3 5
      docs/Makefile
  2. 24 0
      docs/modifytxt.pl

+ 3 - 5
docs/Makefile

@@ -1,11 +1,9 @@
-# Dummy script to generate documentation, probably only works on my system
-# for now.  - mbp / 2002
-
 all:
 all:
-	jade -i html -t sgml -V nochunks -d /usr/share/sgml/docbook/utils-0.6.9/docbook-utils.dsl\#html pisg-doc.sgml | w3m -dump -T text/html > pisg-doc.txt
-	vim -c 'echo AddSpacers()' -c ':wq' pisg-doc.txt
+	jade -i html -t sgml -V nochunks -d /usr/share/sgml/docbook/utils-0.6.9/docbook-utils.dsl\#html pisg-doc.sgml | w3m -dump -T text/html > pisg-tmp.txt
+	cat pisg-tmp.txt | ./modifytxt.pl > pisg-doc.txt
 	docbook2html pisg-doc.sgml -o html
 	docbook2html pisg-doc.sgml -o html
 
 
 clean:
 clean:
 	rm -rf html
 	rm -rf html
 	rm -f pisg-doc.txt
 	rm -f pisg-doc.txt
+	rm -f pisg-tmp.txt

+ 24 - 0
docs/modifytxt.pl

@@ -0,0 +1,24 @@
+#!/usr/bin/perl -w
+
+# This is a small script which modifies the outputted txt docs into a more
+# readable one, by adding some lines to the output.
+
+use strict;
+
+my $cacheword;
+while (<>) {
+    if ($_ =~ /^(\w+)$/ && $_ !~ /^Name$/) {
+        $cacheword = $1;
+    }
+    if ($_ =~ /^Name$/) {
+        print "-----------------------\n$cacheword option\n-----------------------\n";
+    } elsif ($_ =~ /^Description$/) {
+        print "Description\n-----------\n";
+    } elsif ($_ =~ /^Synopsis$/) {
+        print "Synopsis\n--------\n";
+    } else {
+        print $_;
+    }
+
+}
+