diff options
author | Timo Sirainen <cras@irssi.org> | 2001-01-05 09:38:08 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-01-05 09:38:08 +0000 |
commit | 1dc07c42bd2f8977181671fd5bb75bd00ac52bfa (patch) | |
tree | e4823a5f8f17f77d6ba78b22c97e47b3e6ff37c2 /syntax.pl | |
parent | 19d111eff42e2a2d8424383994e9962f611fd912 (diff) | |
download | irssi-1dc07c42bd2f8977181671fd5bb75bd00ac52bfa.zip |
docs generator updates
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1074 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'syntax.pl')
-rwxr-xr-x | syntax.pl | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -12,20 +12,36 @@ $SRC_PATH='src'; $FOO = `find src -name '*.c' -exec ./findsyntax.pl \{\} \\; | sed 's/.*SYNTAX: //' > irssi_syntax`; - while (<docs/help/in/*.in>) { + next if (/Makefile/); + open (FILE, "$_"); @data = <FILE>; close (FILE); + $count = 0; foreach $DATARIVI (@data) { if ($DATARIVI =~ /\@SYNTAX\:(.+)\@/) { $etsittava = "\U$1 "; $SYNTAX = `grep \'^$etsittava\' irssi_syntax`; $SYNTAX =~ s/\*\///g; $SYNTAX =~ s/ *$//; $SYNTAX =~ s/ *\n/\n/g; + + # add %| after "COMMAND SUB " so parameters will indent correctly + $SYNTAX =~ s/^([A-Z ]+)/\1%|/; + $SYNTAX =~ s/(\n[A-Z ]+)/\1%|/g; + # no need for this if there's no parameters + $SYNTAX =~ s/%\|$//; $DATARIVI = $SYNTAX; + } elsif ($DATARIVI =~ /^\S+/) { + chomp $DATARIVI if ($data[$count+1] =~ /^\S+/); } + $count++; } + + # must always end with empty line + push @data, "\n" if ($data[@data-1] ne "\n"); + push @data, "\n" if ($data[@data-2] !~ /\n$/); + $newfilename = $_; $newfilename =~ s/\.in$//; $newfilename =~ s/\/in\//\//; open (NEWFILE, ">$newfilename"); |