diff options
author | Murray Cumming <murrayc@src.gnome.org> | 2003-12-30 10:04:25 +0000 |
---|---|---|
committer | Murray Cumming <murrayc@src.gnome.org> | 2003-12-30 10:04:25 +0000 |
commit | 8155c4ba872ccb9bfe518d0406999c75b82601e5 (patch) | |
tree | 9e198dcc9dbd9ea33715e343a2144d954d511266 /docs | |
parent | 27307593af4a22a368c4685b3116d1e87b19381e (diff) | |
download | glibmm-8155c4ba872ccb9bfe518d0406999c75b82601e5.tar.gz |
Added missing file.
Diffstat (limited to 'docs')
-rwxr-xr-x | docs/reference/beautify_docs.pl.in | 81 |
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/ & /& /; + s/ \* /* /; + + # arg list + s/ &/&/g; + s/&\b/& /g; + s/ \*/*/g; + s/\*\b/* /g; + + # templates + s/\btemplate<\b/template </; + while(s/(.*<) +(.+) +(>.*)/$1$2$3/) {} + } + elsif(/<td class="md(|name)"/) + { + # left parenthesis + s/\( /(/; + + # return value + s/ & /& /g; + s/ \* /* /g; + + # arg list + s/ & /& /g; + s/ \* /* /g; + + # templates + s/\btemplate<\b/template </; + while(s/(.*<) +(.+) +(>.*)/$1$2$3/) {} + } + else + { + # template decls + s/^(|<h\d>)template<\b/$1template </; + } + + push(@outbuf, $_); + } + + open(FILE, '>', $file); + + # write the whole buffer back + print FILE "$_" foreach(@outbuf); + + close(FILE); +} + |