From 114a878c64ce6f8223cfd22d76a20eb16d177e5e Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: 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 --- doc/tools/Makefile.am | 4 +++ doc/tools/index-python | 52 ++++++++++++++++++++++++++++++++++++ doc/tools/index-texi | 60 ++++++++++++++++++++++++++++++++++++++++++ doc/tools/index.xsl | 34 ++++++++++++++++++++++++ doc/tools/toc-docbook | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++ doc/tools/toc-gsdoc | 24 +++++++++++++++++ doc/tools/toc-python | 57 ++++++++++++++++++++++++++++++++++++++++ doc/tools/toc-texi | 47 +++++++++++++++++++++++++++++++++ 8 files changed, 349 insertions(+) create mode 100644 doc/tools/Makefile.am create mode 100644 doc/tools/index-python create mode 100755 doc/tools/index-texi create mode 100644 doc/tools/index.xsl create mode 100644 doc/tools/toc-docbook create mode 100644 doc/tools/toc-gsdoc create mode 100644 doc/tools/toc-python create mode 100755 doc/tools/toc-texi (limited to 'doc/tools') diff --git a/doc/tools/Makefile.am b/doc/tools/Makefile.am new file mode 100644 index 00000000..4eb7f5af --- /dev/null +++ b/doc/tools/Makefile.am @@ -0,0 +1,4 @@ +EXTRA_DIST = index-texi index-python index.xsl \ + toc-gsdoc toc-docbook toc-python + + diff --git a/doc/tools/index-python b/doc/tools/index-python new file mode 100644 index 00000000..96cfcd8f --- /dev/null +++ b/doc/tools/index-python @@ -0,0 +1,52 @@ +#!/usr/bin/perl + +use Getopt::Long; + +my $prefix = ''; +GetOptions( 'prefix=s' => \$prefix ) || die "Wrong options\n"; + +$file = $ARGV[0]; +open(FILE, "$file") || die "File not found: $file\n"; + +print "\n"; + +$ingroup = 0; +while () { + + if (/\\(.+)\<\/a\>/) { +# print "Index: $1, $2, $ingroup\n"; + if ($ingroup) { + $name = "$ingroup, $2"; + } else { + $name = $2; + } + $url = "$prefix/$1"; + print "\n"; + } elsif (/\(.+)/) { +# print "Ingroup: $1\n"; + $ingroup = $1; + } elsif (/\s+\<\/dl>/) { + $ingroup = 0; + } +} + +print "\n"; +close(FILE); + + +sub dehtml +{ + my ( $str ) = @_; + + $str =~ s/\//g; + $str =~ s/\<\/CODE\>//g; + $str =~ s/\//g; + $str =~ s/\<\/TT\>//g; + + return $str; +} + +# Local Variables: +# mode: perl +# fill-column: 120 +# End: 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 () { + + if (/\\(.*)\<\/A\>\<\/H1\>/) { + $index = $mapping{$1}; +# print "Index: $1 => $index\n"; + } elsif (/\/) { + $indir = 1; + } elsif (/\<\/DIR>/) { + $indir = 0; + } elsif ($indir) { + if (/\\([^<]*)\<\/A\>/) { + unless ($lastindex eq $index) { + if ($lastindex) { + print "\n"; + } + print "<$index>\n"; + $lastindex = $index; + } + $name = dehtml($2); + $url = $1; + print STDOUT "\n"; + } + } + } + + close(FILE); +} + +if ($lastindex) { + print "\n"; +} + +sub dehtml +{ + my ( $str ) = @_; + + $str =~ s/\//g; + $str =~ s/\<\/CODE\>//g; + $str =~ s/\//g; + $str =~ s/\<\/TT\>//g; + + return $str; +} + +# Local Variables: +# mode: perl +# fill-column: 120 +# End: diff --git a/doc/tools/index.xsl b/doc/tools/index.xsl new file mode 100644 index 00000000..8d3d0a52 --- /dev/null +++ b/doc/tools/index.xsl @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/tools/toc-docbook b/doc/tools/toc-docbook new file mode 100644 index 00000000..6d16f9b3 --- /dev/null +++ b/doc/tools/toc-docbook @@ -0,0 +1,71 @@ +#!/usr/bin/perl + +# Copyright (C) 2001 by Claudiu Costin +# +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +use Getopt::Long; + +my $prefix = ''; +my $depth = 1; +GetOptions( 'prefix=s' => \$prefix, + 'depth=i' => \$depth ) || die "Wrong options\n"; + +$initialdepth = $depth; +$b3=$b2=$b1=""; +$in_processing=0; +while (<>) { + chop; + + if (/Table of Contents<\/B/) { + $in_processing=1; + next; + } + last if (/List of Tables/); + next if (!$in_processing); + + if (/HREF=\"(.+)\"/) { + $url = $1; + } + if (/>(.+)<\/A/) { + $name=$1; + $name =~ s/\"/"e;/g; + $name =~ s/—/-/g; + $name =~ s/^\s*-?\s*//g; + $name =~ s/\.$//g; +# print "NAME $name\n"; + } + + if ($b3 =~ />
<\/DL/i) { + $depth--; + print " "x($depth-1) . "\n" if ($depth != $initialdepth-1); + $b3=$b2; + $b2=$b1; + $b1=$_; + next; + } + + if ($b3 =~ />.*<\/DT/i && $name ne "" && $url ne "") { + if ($b1 =~ />
\n"; + } else { + print " "x($depth-1) . "\n"; + } + } + + # a simulated delay line with 6 cells + $b3=$b2; + $b2=$b1; + $b1=$_; +} diff --git a/doc/tools/toc-gsdoc b/doc/tools/toc-gsdoc new file mode 100644 index 00000000..69785d91 --- /dev/null +++ b/doc/tools/toc-gsdoc @@ -0,0 +1,24 @@ +#!/usr/bin/perl + +use Getopt::Long; + +my $prefix = ''; +GetOptions( 'title=s' => \$title, + 'main=s' => \$main ) || die "Wrong options\n"; + +$file = $ARGV[0]; +open(FILE, "$file") || die "File not found: $file\n"; + +print "\n"; + +while () { + + if (/\\(.+)\<\/uref\>\<\/item\>/) { + $name = $1; + $url = "$1.html"; + print " \n"; + } + +} + +print "\n"; diff --git a/doc/tools/toc-python b/doc/tools/toc-python new file mode 100644 index 00000000..c91cdcf2 --- /dev/null +++ b/doc/tools/toc-python @@ -0,0 +1,57 @@ +#!/usr/bin/perl + +use Getopt::Long; + +my $prefix = ''; +GetOptions( 'prefix=s' => \$prefix, + 'title=s' => \$title, + 'main=s' => \$main ) || die "Wrong options\n"; + +$file = $ARGV[0]; +open(FILE, "$file") || die "File not found: $file\n"; + +$prevdepth = 1; +$depth = 1; +print ") { + + if (/^\s*href/ && !/.*\<\/A\>$/i) { + chop; + $_ = $_ . ; + } + if (/\/i) { + $depth++; + } elsif (/\<\/UL\>/i) { + print "/" if ($prevdepth == $depth); + $depth--; + print ">\n(.+)\<\/A\>$/i) { + $url = "$prefix/$1"; + $name = dehtml($2); + $name =~ s/\s+/ /g; + print "/" if ($prevdepth == $depth); + print ">\n\n"; +close(FILE); + +sub dehtml +{ + my ( $str ) = @_; + + $str =~ s/\<(tt|b) class=\"([^\"]*)\"\>//g; + $str =~ s/\<\/(tt|b)\>//g; + $str =~ s/\//g; + $str =~ s/\<\/i\>//g; + + return $str; +} + +# Local Variables: +# mode: perl +# fill-column: 120 +# End: diff --git a/doc/tools/toc-texi b/doc/tools/toc-texi new file mode 100755 index 00000000..2be48fa6 --- /dev/null +++ b/doc/tools/toc-texi @@ -0,0 +1,47 @@ +#!/usr/bin/perl + +# Copyright (C) 2001 by Claudiu Costin +# +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +$depth=0; +$buffer=""; + +while (<>) { + chop; + + if ($buffer =~ /
    /i) { + $depth++; + $buffer = $_; + next; + } + if ($buffer =~ /<\/ul>/i) { + $depth--; + print " "x($depth-1) . "\n" if ($depth != 0); + $buffer = $_; + next; + } + + if ($buffer =~ /
  • /i) { + $buffer =~ /HREF=\"([^\"]+)\"/; + $url=$1; + $buffer =~ /\">(.+)<\/A>/; + $text=$1; + $text =~ s///gi; + $text =~ s/<\/tt>//gi; + $text =~ s///gi; + $text =~ s/<\/CODE>//gi; + $text =~ s/
    //gi; + if (/
      /i) { + print " "x($depth-1) . "\n"; + } else { + print " "x($depth-1) . "\n"; + } + } + # a simulated delay line with one cell + $buffer = $_; +} -- cgit v1.2.1