summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@src.gnome.org>2003-12-30 10:04:25 +0000
committerMurray Cumming <murrayc@src.gnome.org>2003-12-30 10:04:25 +0000
commit8155c4ba872ccb9bfe518d0406999c75b82601e5 (patch)
tree9e198dcc9dbd9ea33715e343a2144d954d511266 /docs
parent27307593af4a22a368c4685b3116d1e87b19381e (diff)
downloadglibmm-8155c4ba872ccb9bfe518d0406999c75b82601e5.tar.gz
Added missing file.
Diffstat (limited to 'docs')
-rwxr-xr-xdocs/reference/beautify_docs.pl.in81
1 files changed, 81 insertions, 0 deletions
diff --git a/docs/reference/beautify_docs.pl.in b/docs/reference/beautify_docs.pl.in
new file mode 100755
index 00000000..28df9e11
--- /dev/null
+++ b/docs/reference/beautify_docs.pl.in
@@ -0,0 +1,81 @@
+#! @PERL_PATH@
+#
+# @configure_input@
+#
+
+#sub main()
+{
+ my $directory = ".";
+ $directory = $ARGV[0] unless scalar(@ARGV) == 0;
+ print "processing directory $directory...\n" unless $directory =~ /^\.?$/;
+
+ foreach(`find "$directory" -type f -name '*.html'`)
+ {
+ chomp;
+ /([^\/]+)$/;
+ print "processing $1...\n";
+ &process($_);
+ }
+
+ exit 0;
+}
+
+sub process($)
+{
+ my ($file) = @_;
+ my @outbuf;
+
+ open(FILE, '<', $file);
+
+ while(<FILE>)
+ {
+ if(/<a class="el"/)
+ {
+ # return value
+ s/ &amp;&nbsp;/&amp;&nbsp;/;
+ s/ \*&nbsp;/*&nbsp;/;
+
+ # arg list
+ s/ &amp;/&amp;/g;
+ s/&amp;\b/&amp; /g;
+ s/ \*/*/g;
+ s/\*\b/* /g;
+
+ # templates
+ s/\btemplate&lt;\b/template &lt;/;
+ while(s/(.*&lt;) +(.+) +(&gt;.*)/$1$2$3/) {}
+ }
+ elsif(/<td class="md(|name)"/)
+ {
+ # left parenthesis
+ s/\(&nbsp;/(/;
+
+ # return value
+ s/ &amp; /&amp; /g;
+ s/ \* /* /g;
+
+ # arg list
+ s/ &amp;&nbsp;/&amp;&nbsp;/g;
+ s/ \*&nbsp;/*&nbsp;/g;
+
+ # templates
+ s/\btemplate&lt;\b/template &lt;/;
+ while(s/(.*&lt;) +(.+) +(&gt;.*)/$1$2$3/) {}
+ }
+ else
+ {
+ # template decls
+ s/^(|<h\d>)template&lt;\b/$1template &lt;/;
+ }
+
+ push(@outbuf, $_);
+ }
+
+ open(FILE, '>', $file);
+
+ # write the whole buffer back
+ print FILE "$_" foreach(@outbuf);
+
+ close(FILE);
+}
+