diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch) | |
tree | acaf47eb0fa12142d3896416a69e74cbf5a72242 /doc/tools/index-texi | |
download | tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'doc/tools/index-texi')
-rwxr-xr-x | doc/tools/index-texi | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/doc/tools/index-texi b/doc/tools/index-texi new file mode 100755 index 00000000..8aa85184 --- /dev/null +++ b/doc/tools/index-texi @@ -0,0 +1,60 @@ +#!/usr/bin/perl + +use Getopt::Long; + +GetOptions( 'map=s' => \%mapping ) || die "Wrong options\n"; + +for $file (@ARGV) { + + open(FILE, "$file") || die "File not found: $file\n"; + + $indir = 0; + + while (<FILE>) { + + if (/\<H1\>\<A NAME=\".*\" HREF=\".*\"\>(.*)\<\/A\>\<\/H1\>/) { + $index = $mapping{$1}; +# print "Index: $1 => $index\n"; + } elsif (/\<DIR\>/) { + $indir = 1; + } elsif (/\<\/DIR>/) { + $indir = 0; + } elsif ($indir) { + if (/\<LI\>\<A HREF=\"([^\"]*)\"\>([^<]*)\<\/A\>/) { + unless ($lastindex eq $index) { + if ($lastindex) { + print "</$lastindex>\n"; + } + print "<$index>\n"; + $lastindex = $index; + } + $name = dehtml($2); + $url = $1; + print STDOUT "<entry name=\"$name\" url=\"$url\"/>\n"; + } + } + } + + close(FILE); +} + +if ($lastindex) { + print "</$lastindex>\n"; +} + +sub dehtml +{ + my ( $str ) = @_; + + $str =~ s/\<CODE\>//g; + $str =~ s/\<\/CODE\>//g; + $str =~ s/\<TT\>//g; + $str =~ s/\<\/TT\>//g; + + return $str; +} + +# Local Variables: +# mode: perl +# fill-column: 120 +# End: |