diff options
author | Lars G Thorsen <[email protected]> | 2010-01-26 10:13:35 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-01-26 18:55:11 +0100 |
commit | df88b47cdafcc2e04452456942ea572a7b72e2f2 (patch) | |
tree | 36da537a36b45ff406acb8e714dde97bbe31e7af /system/doc/top/bin | |
parent | 39ff2b44d130179d3ce722a9b3c07d27bfb72a2a (diff) | |
download | otp-df88b47cdafcc2e04452456942ea572a7b72e2f2.tar.gz otp-df88b47cdafcc2e04452456942ea572a7b72e2f2.tar.bz2 otp-df88b47cdafcc2e04452456942ea572a7b72e2f2.zip |
OTP-8343 The documentation is now possible to build in an open source
environment after a number of bugs are fixed and some features
are added in the documentation build process.
- The arity calculation is updated.
- The module prefix used in the function names for bif's are
removed in the generated links so the links will look like
http://www.erlang.org/doc/man/erlang.html#append_element-2
instead of
http://www.erlang.org/doc/man/erlang.html#erlang:append_element-2
- Enhanced the menu positioning in the html documentation when a
new page is loaded.
- A number of corrections in the generation of man pages (thanks
to Sergei Golovan)
- Moved some man pages to more apropriate sections, pages in
section 4 moved to 5 and pages in 6 moved to 7.
- The legal notice is taken from the xml book file so OTP's
build process can be used for non OTP applications.
Diffstat (limited to 'system/doc/top/bin')
-rwxr-xr-x[l---------] | system/doc/top/bin/otp_man_index | 107 |
1 files changed, 106 insertions, 1 deletions
diff --git a/system/doc/top/bin/otp_man_index b/system/doc/top/bin/otp_man_index index bb913b25df..57a0f12d32 120000..100755 --- a/system/doc/top/bin/otp_man_index +++ b/system/doc/top/bin/otp_man_index @@ -1 +1,106 @@ -../../../../internal_tools/integration/scripts/otp_man_index
\ No newline at end of file +#!/opt/local/bin/perl + +use File::Find; +use strict; + +######################################### +# Usage: +# $ cd $ERLANG_RELEASE +# otp_man_index > doc/man_index.html +######################################### + +my (@list,$info); + +find(\&wanted,'.'); + +header(); + +foreach $info (sort {lc($a->[0]) cmp lc($b->[0])} @list) { + my ($module,$application,$dir,$path) = @$info; + + my $idx = -f "$dir/index.html" ? "$dir/index.html" : "$dir/../index.html"; + # Remove .html extension from module name, if there is one + if ($module =~ /(\w+).html$/) { + $module = "$1"; + } + print " <TR>\n"; + print " <TD><A HREF=\"../$path\">$module</A></TD>\n"; + print " <TD><A HREF=\"../$idx\">$application</A></TD>\n"; + print " </TR>\n"; +} + +footer(); + +########################################################################### + +sub wanted { + return unless /\.html$/ and -f $_; + + open(FILE,$_) or die "ERROR: Can't open $File::Find::name: $!\n"; + my $line; + + while (defined ($line = <FILE>)) { + if ($line =~ /<!-- refpage -->/) { + close FILE; + my $path = $File::Find::name; + $path =~ s/\.\///; # Remove './' prefix + my $dir = $File::Find::dir; + $dir =~ s/\.\///; # Remove './' prefix + $dir =~ m&([^/]+)/doc/html$&; + my $application = $1; + push(@list, [$_,$application,$dir,$path]); + return; + } + } + close FILE; +} + + +sub header { + print <<EOS; +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<!-- This file was generated by the otp_man_index script --> +<HTML> +<HEAD> + <link rel="stylesheet" href="otp_doc.css" type="text/css"/> + <TITLE>Erlang/OTP Manual Page Index</TITLE> +</HEAD> +<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#FF00FF" + ALINK="#FF0000"> +<CENTER> +<!-- A HREF="http://www.erlang.org/"> +<img alt="Erlang logo" src="erlang-logo.png"/ > +</A><BR --> +<SMALL> +[<A HREF="index.html">Up</A> | +<A HREF="http://www.erlang.org/">Erlang</A>] +</SMALL><BR> +<P><FONT SIZE="+4">Manual Page Index</FONT><BR> +</CENTER> +<CENTER> +<P> +<TABLE BORDER=1> +<TR> + <TH>Manual Page</TH><TH>Application</TH> +</TR> +EOS +} + +sub footer { + my $year = (localtime)[5] + 1900; + print <<EOS; +</TABLE> +</CENTER> +<P> +<CENTER> +<HR> +<SMALL> +Copyright © 1991-$year +<a href="http://www.ericsson.com/technology/opensource/erlang/"> +Ericsson AB</a> +</SMALL> +</CENTER> +</BODY> +</HTML> +EOS +} |