aboutsummaryrefslogtreecommitdiff
path: root/docs/autodocifier.pl
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-03-13 08:32:14 +0000
committerEric Andersen <andersen@codepoet.org>2004-03-13 08:32:14 +0000
commit55c704c119c871e25253d8dc3582f623d7d47708 (patch)
treeefb07ee478a87f68f1f508a1c620ea1d28a3de8a /docs/autodocifier.pl
parented43806c3b3394ea4ee94c5c9ab042d0aa51f033 (diff)
downloadbusybox-w32-55c704c119c871e25253d8dc3582f623d7d47708.tar.gz
busybox-w32-55c704c119c871e25253d8dc3582f623d7d47708.tar.bz2
busybox-w32-55c704c119c871e25253d8dc3582f623d7d47708.zip
Fix some doc generation problems
Diffstat (limited to 'docs/autodocifier.pl')
-rwxr-xr-xdocs/autodocifier.pl34
1 files changed, 19 insertions, 15 deletions
diff --git a/docs/autodocifier.pl b/docs/autodocifier.pl
index e06a1dad8..e1101d9d0 100755
--- a/docs/autodocifier.pl
+++ b/docs/autodocifier.pl
@@ -3,7 +3,7 @@
3use strict; 3use strict;
4use Getopt::Long; 4use Getopt::Long;
5 5
6# collect lines continued with a '\' into an array 6# collect lines continued with a '\' into an array
7sub continuation { 7sub continuation {
8 my $fh = shift; 8 my $fh = shift;
9 my @line; 9 my @line;
@@ -26,7 +26,7 @@ sub beautify {
26 $text =~ s/"\s*"//sg; 26 $text =~ s/"\s*"//sg;
27 my @line = split("\n", $text); 27 my @line = split("\n", $text);
28 $text = join('', 28 $text = join('',
29 map { 29 map {
30 s/^\s*"//; 30 s/^\s*"//;
31 s/"\s*$//; 31 s/"\s*$//;
32 s/%/%%/g; 32 s/%/%%/g;
@@ -42,10 +42,17 @@ sub pod_for_usage {
42 my $name = shift; 42 my $name = shift;
43 my $usage = shift; 43 my $usage = shift;
44 44
45 # Sigh. Fixup the known odd-name applets.
46 $name =~ s/dpkg_deb/dpkg-deb/g;
47 $name =~ s/fsck_minix/fsck.minix/g;
48 $name =~ s/mkfs_minix/mkfs.minix/g;
49 $name =~ s/run_parts/run-parts/g;
50 $name =~ s/start_stop_daemon/start-stop-daemon/g;
51
45 # make options bold 52 # make options bold
46 my $trivial = $usage->{trivial}; 53 my $trivial = $usage->{trivial};
47 $trivial =~ s/(?<!\w)(-\w+)/B<$1>/sxg; 54 $trivial =~ s/(?<!\w)(-\w+)/B<$1>/sxg;
48 my @f0 = 55 my @f0 =
49 map { $_ !~ /^\s/ && s/(?<!\w)(-\w+)/B<$1>/g; $_ } 56 map { $_ !~ /^\s/ && s/(?<!\w)(-\w+)/B<$1>/g; $_ }
50 split("\n", $usage->{full}); 57 split("\n", $usage->{full});
51 58
@@ -69,22 +76,19 @@ sub pod_for_usage {
69 76
70 # prepare examples if they exist 77 # prepare examples if they exist
71 my $example = (defined $usage->{example}) 78 my $example = (defined $usage->{example})
72 ? 79 ?
73 "Example:\n\n" . 80 "Example:\n\n" .
74 join ("\n", 81 join ("\n",
75 map { "\t$_" } 82 map { "\t$_" }
76 split("\n", $usage->{example})) . "\n\n" 83 split("\n", $usage->{example})) . "\n\n"
77 : ""; 84 : "";
78 85
79 return 86 return
80 "=item B<$name>". 87 "=item B<$name>".
81 "\n\n" . 88 "\n\n$name $trivial\n\n".
82 "$name $trivial". 89 "$full\n\n" .
83 "\n\n" . 90 "$notes" .
84 $full . 91 "$example" .
85 "\n\n" .
86 $notes .
87 $example.
88 "-------------------------------". 92 "-------------------------------".
89 "\n\n" 93 "\n\n"
90 ; 94 ;
@@ -101,7 +105,7 @@ sub sgml_for_usage {
101 ; 105 ;
102} 106}
103 107
104# the keys are applet names, and 108# the keys are applet names, and
105# the values will contain hashrefs of the form: 109# the values will contain hashrefs of the form:
106# 110#
107# { 111# {
@@ -288,4 +292,4 @@ John BEPPU <b@ax9.org>
288 292
289=cut 293=cut
290 294
291# $Id: autodocifier.pl,v 1.24 2003/07/14 21:20:48 andersen Exp $ 295# $Id: autodocifier.pl,v 1.25 2004/03/13 08:32:14 andersen Exp $