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 | |
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')
-rwxr-xr-x[l---------] | system/doc/top/bin/otp_man_index | 107 | ||||
-rw-r--r--[l---------] | system/doc/top/src/erl_html_tools.erl | 728 | ||||
-rw-r--r--[l---------] | system/doc/top/src/erlresolvelinks.erl | 145 | ||||
l--------- | system/doc/top/src/permuted_index.erl | 1 | ||||
-rw-r--r-- | system/doc/top/templates/erlang.gif | bin | 2162 -> 0 bytes | |||
-rw-r--r-- | system/doc/top/templates/first.html.src | 104 | ||||
-rwxr-xr-x | system/doc/top/templates/flip_closed.gif | bin | 82 -> 0 bytes | |||
-rwxr-xr-x | system/doc/top/templates/flip_google.gif | bin | 257 -> 0 bytes | |||
-rwxr-xr-x | system/doc/top/templates/flip_open.gif | bin | 86 -> 0 bytes | |||
-rwxr-xr-x | system/doc/top/templates/flip_static.gif | bin | 109 -> 0 bytes | |||
-rwxr-xr-x | system/doc/top/templates/flipmenu.js | 342 | ||||
-rw-r--r-- | system/doc/top/templates/index.html.src | 4 | ||||
-rw-r--r-- | system/doc/top/templates/otp_top.css | 53 | ||||
-rw-r--r-- | system/doc/top/templates/system.html.src | 281 | ||||
-rw-r--r-- | system/doc/top/templates/toc_.html.src | 105 |
15 files changed, 979 insertions, 891 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 +} diff --git a/system/doc/top/src/erl_html_tools.erl b/system/doc/top/src/erl_html_tools.erl index 35a199b08d..d93516768e 120000..100644 --- a/system/doc/top/src/erl_html_tools.erl +++ b/system/doc/top/src/erl_html_tools.erl @@ -1 +1,727 @@ -../../../../internal_tools/integration/scripts/make_index/erl_html_tools.erl
\ No newline at end of file +%% ``The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved via the world wide web at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% The Initial Developer of the Original Code is Ericsson Utvecklings AB. +%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings +%% AB. All Rights Reserved.'' +%% +-module(erl_html_tools). + +%% This file contains tools for updating HTML files in an installed system +%% depending on the installed applications. Currently the only use is +%% to update the top index file. + + +%% ------ VERY IMPORTANT ------ +%% +%% Original location for this file: +%% /clearcase/otp/internal_tools/integration/scripts/make_index/ +%% When updating this file, copy the source to +%% /home/otp/patch/share/program/ +%% and place .beam files (compiled with correct release) in all +%% /home/otp/patch/share/program/<release> +%% for releases >= R9C +%% +%% ---------------------------- + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% This program generate the top index files for the OTP documentation. +% Part of the HTML code is in templates, like "index.html.src" and +% part is written out from this module. So the program and the templates +% has to match. +% +% The templates are searched from the current directory, a directory +% "templates" relative to the current directory or at RootDir. +% +% RootDir is given as an argument or assumed to be code:root_dir(), +% i.e. the root of the system running this program. +% +% The output is put into DestDir or RootDir if not given. +% +% The functions to call are +% +% top_index() +% top_index([RootDir]) +% top_index([RootDir,DestDir,OtpRel]) +% top_index(RootDir) +% top_index(RootDir, DestDir, OtpRel) +% +% where RootDir can be a string or an atom. +% +% +% USING THIS SCRIPT FROM THE UNIX COMMAND LINE +% -------------------------------------------- +% If the Erlang started is the same as the Erlang to create index.html +% for the use +% +% % erl -noshell -s erl_html_tools top_index +% +% If you want to create an index for another Erlang installation or +% documentation located separate from the object code, then use +% +% % erl -noshell -s erl_html_tools top_index /path/to/erlang/root +% +% +% COLLECTING INFORMATION +% ---------------------- +% This script assumes that all applications have an "info" file +% in their top directory. This file should have some keywords with +% values defined. The keys are 'group' and 'short' (for "short +% description). See the OTP applications for examples. +% +% Some HTML code is generated by this program, others are taken from +% the file "index.html.src" that may be located in the patch directory +% or in the "$ERLANG_ROOT/doc/" directory. +% +% The code for creating the top index page assumes all applications +% have a file "info" with some fields filled in +% +% short: Text Short text describing the application +% group: tag [Heading] Group tag optionally followed by a description. +% Only one app need to describe the group but +% more than one can. +% +% FIXME: Check that there is documentation for the application, not just +% an info file. +% FIXME: Use records, it is now unreadable :-( +% FIXME: Use a separate URL and URLIndexFile +% FIXME: Pass the OTP release name as an argument instead of in +% process dictionary (for elegance). + +-export([top_index/0,top_index/1,top_index/3,top_index_silent/3]). + +% This is the order groups are inserted into the file. Groups +% not in this list is inserted in undefined order. + +group_order() -> + [ + basic, + dat, + oam, + orb, + comm, + tools + ]. + +top_index() -> + top_index(code:root_dir()). + +top_index([RootDir]) when atom(RootDir) -> + top_index(atom_to_list(RootDir)); +top_index([RootDir,DestDir,OtpRel]) + when is_atom(RootDir), is_atom(DestDir), is_atom(OtpRel) -> + top_index(atom_to_list(RootDir), atom_to_list(DestDir), atom_to_list(OtpRel)); +top_index(RootDir) -> + {_,RelName} = init:script_id(), + top_index(RootDir, filename:join(RootDir, "doc"), RelName). + +top_index(RootDir, DestDir, OtpRel) -> + report("****\nRootDir: ~p", [RootDir]), + report("****\nDestDir: ~p", [DestDir]), + report("****\nOtpRel: ~p", [OtpRel]), + + put(otp_release, OtpRel), + + Templates = find_templates(["","templates",DestDir]), + report("****\nTemplates: ~p", [Templates]), + Bases = [{"../lib/", filename:join(RootDir,"lib")}, + {"../", RootDir}], + Groups = find_information(Bases), + report("****\nGroups: ~p", [Groups]), + process_templates(Templates, DestDir, Groups). + +top_index_silent(RootDir, DestDir, OtpRel) -> + put(silent,true), + Result = top_index(RootDir, DestDir, OtpRel), + erase(silent), + Result. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Main loop - process templates +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +process_templates([], _DestDir, _Groups) -> + report("\n", []); +process_templates([Template | Templates], DestDir, Groups) -> + report("****\nIN-FILE: ~s", [Template]), + BaseName = filename:basename(Template, ".src"), + case lists:reverse(filename:rootname(BaseName)) of + "_"++_ -> + %% One template expands to several output files. + process_multi_template(BaseName, Template, DestDir, Groups); + _ -> + %% Standard one-to-one template. + OutFile = filename:join(DestDir, BaseName), + subst_file("", OutFile, Template, Groups) + end, + process_templates(Templates, DestDir, Groups). + + +process_multi_template(BaseName0, Template, DestDir, Info) -> + Ext = filename:extension(BaseName0), + BaseName1 = filename:basename(BaseName0, Ext), + [_|BaseName2] = lists:reverse(BaseName1), + BaseName = lists:reverse(BaseName2), + Groups0 = [{[$_|atom_to_list(G)],G} || G <- group_order()], + Groups = [{"",basic}|Groups0], + process_multi_template_1(Groups, BaseName, Ext, Template, DestDir, Info). + +process_multi_template_1([{Suffix,Group}|Gs], BaseName, Ext, Template, DestDir, Info) -> + OutFile = filename:join(DestDir, BaseName++Suffix++Ext), + subst_file(Group, OutFile, Template, Info), + process_multi_template_1(Gs, BaseName, Ext, Template, DestDir, Info); +process_multi_template_1([], _, _, _, _, _) -> ok. + +subst_file(Group, OutFile, Template, Info) -> + report("\nOUTFILE: ~s", [OutFile]), + case subst_template(Group, Template, Info) of + {ok,Text,_NewInfo} -> + case file:open(OutFile, [write]) of + {ok, Stream} -> + file:write(Stream, Text), + file:close(Stream); + Error -> + error("Can't write to file ~s: ~w", [OutFile,Error]) + end; + Error -> + error("Can't write to file ~s: ~w", [OutFile,Error]) + end. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Find the templates +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +find_templates(SearchPaths) -> + find_templates(SearchPaths, SearchPaths). + +find_templates([SearchPath | SearchPaths], AllSearchPaths) -> + case filelib:wildcard(filename:join(SearchPath, "*.html.src")) of + [] -> + find_templates(SearchPaths, AllSearchPaths); + Result -> + Result + end; +find_templates([], AllSearchPaths) -> + error("No templates found in ~p",[AllSearchPaths]). + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% This function read all application names and if present all "info" files. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +find_information(Bases) -> + Paths = find_application_paths(Bases), +% report("****\nPaths: ~p", [Paths]), + Apps = find_application_infos(Paths), +% report("****\nApps: ~p", [Apps]), + form_groups(Apps). + +% The input is a list of tuples of the form +% +% IN: [{BaseURL,SearchDir}, ...] +% +% and the output is a list +% +% OUT: [{Appname,AppVersion,AppPath,IndexUTL}, ...] +% +% We know URL ends in a slash. + +find_application_paths([]) -> + []; +find_application_paths([{URL,Dir} | Paths]) -> + Sub1 = "doc/html/index.html", +%% Sub2 = "doc/index.html", + case file:list_dir(Dir) of + {ok, Dirs} -> + AppDirs = + lists:filter( + fun(E) -> + is_match(E, "^[A-Za-z0-9_]+-[0-9\\.]+") + end, Dirs), + AppPaths = + lists:map( + fun(AppDir) -> + {ok,[App,Ver]} = regexp:split(AppDir, "-"), + DirPath = filename:join(Dir,AppDir), + AppURL = URL ++ AppDir, + {App,Ver,DirPath,AppURL ++ "/" ++ Sub1} +%% case file:read_file_info( +%% filename:join(DirPath, Sub1)) of +%% {ok, _} -> +%% {App,Ver,DirPath,AppURL ++ "/" ++ Sub1}; +%% _ -> +%% {App,Ver,DirPath,AppURL ++ "/" ++ Sub2} +%% end + end, AppDirs), + AppPaths ++ find_application_paths(Paths) + end. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Find info for one application. +% Read the "info" file for each application. Look at "group" and "short". +% key words. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% IN: [{Appname,AppVersion,AppPath,IndexUTL}, ...] +% OUT: [{Group,Heading,[{AppName,[{AppVersion,Path,URL,Text} | ...]} +% | ...]}, ...] + +find_application_infos([]) -> + []; +find_application_infos([{App,Ver,AppPath,IndexURL} | Paths]) -> + case read_info(filename:join(AppPath,"info")) of + {error,_Reason} -> + warning("No info for app ~p", [AppPath]), + find_application_infos(Paths); + Db -> + {Group,Heading} = + case lists:keysearch("group", 1, Db) of + {value, {_, G0}} -> + % This value may be in two parts, + % tag and desciption + case string:str(G0," ") of + 0 -> + {list_to_atom(G0),""}; + N -> + {list_to_atom(string:substr(G0,1,N-1)), + string:substr(G0,N+1)} + end; + false -> + error("No group given",[]) + end, + Text = + case lists:keysearch("short", 1, Db) of + {value, {_, G1}} -> + G1; + false -> + "" + end, + [{Group,Heading,{App,{Ver,AppPath,IndexURL,Text}}} + | find_application_infos(Paths)] + end. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Group into one list element for each group name. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% IN : {Group,Heading,{AppName,{AppVersion,Path,URL,Text}}} +% OUT: {Group,Heading,[{AppName,[{AppVersion,Path,URL,Text} | ...]} | ...]} + +form_groups(Apps) -> + group_apps(lists:sort(Apps)). + +group_apps([{Group,Heading,AppInfo} | Info]) -> + group_apps(Info, Group, Heading, [AppInfo]); +group_apps([]) -> + []. + +% First description +group_apps([{Group,"",AppInfo} | Info], Group, Heading, AppInfos) -> + group_apps(Info, Group, Heading, [AppInfo | AppInfos]); +group_apps([{Group,Heading,AppInfo} | Info], Group, "", AppInfos) -> + group_apps(Info, Group, Heading, [AppInfo | AppInfos]); +% Exact match +group_apps([{Group,Heading,AppInfo} | Info], Group, Heading, AppInfos) -> + group_apps(Info, Group, Heading, [AppInfo | AppInfos]); +% Different descriptions +group_apps([{Group,_OtherHeading,AppInfo} | Info], Group, Heading, AppInfos) -> + warning("Group ~w descriptions differ",[Group]), + group_apps(Info, Group, Heading, [AppInfo | AppInfos]); +group_apps(Info, Group, Heading, AppInfos) -> + [{Group,Heading,combine_apps(AppInfos)} | group_apps(Info)]. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Group into one list element for each application name. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% IN : {AppName,{AppVersion,Path,URL,Text}} +% OUT: {AppName,[{AppVersion,Path,URL,Text} | ...]} + +combine_apps(Apps) -> + combine_apps(Apps,[],[]). + +combine_apps([{AppName,{Vsn1,Path1,URL1,Text1}}, + {AppName,{Vsn2,Path2,URL2,Text2}} | Apps], AppAcc, Acc) -> + combine_apps([{AppName,{Vsn2,Path2,URL2,Text2}} | Apps], + [{Vsn1,Path1,URL1,Text1} | AppAcc], + Acc); +combine_apps([{AppName,{Vsn1,Path1,URL1,Text1}}, + {NewAppName,{Vsn2,Path2,URL2,Text2}} | Apps], AppAcc, Acc) -> + App = lists:sort(fun vsncmp/2,[{Vsn1,Path1,URL1,Text1}|AppAcc]), + combine_apps([{NewAppName,{Vsn2,Path2,URL2,Text2}} | Apps], + [], + [{AppName,App}|Acc]); +combine_apps([{AppName,{Vsn,Path,URL,Text}}], AppAcc, Acc) -> + App = lists:sort(fun vsncmp/2,[{Vsn,Path,URL,Text}|AppAcc]), + [{AppName,App}|Acc]. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Open a template and fill in the missing parts +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% IN : {Group,Heading,[{AppName,[{AppVersion,Path,URL,Text} | ...]} | ...]} +% OUT: String that is the HTML code + +subst_template(Group, File, Info) -> + case file:open(File, read) of + {ok,Stream} -> + Res = subst_template_1(Group, Stream, Info), + file:close(Stream), + Res; + {error,Reason} -> + {error, Reason} + end. + +subst_template_1(Group, Stream, Info) -> + case file:read(Stream, 100000) of + {ok, Template} -> + Fun = fun(Match, _) -> {subst(Match, Info, Group),Info} end, + gsub(Template, "#[A-Za-z0-9]+#", Fun, Info); + {error, Reason} -> + {error, Reason} + end. + +get_version(Info) -> + case lists:keysearch('runtime', 1, Info) of + {value, {_,_,Apps}} -> + case lists:keysearch("erts", 1, Apps) of + {value, {_,[{Vers,_,_,_} | _]}} -> + Vers; + _ -> + "" + end; + _ -> + "" + end. + +subst("#release#", _Info, _Group) -> + get(otp_release); +subst("#version#", Info, _Group) -> + get_version(Info); +subst("#copyright#", _Info, _Group) -> + "copyright Copyright © 1991-2004"; +subst("#groups#", Info, _Group) -> + [ + "<table border=0 width=\"90%\" cellspacing=3 cellpadding=5>\n", + subst_groups(Info), + "</table>\n" + ]; +subst("#applinks#", Info, Group) -> + subst_applinks(Info, Group); +subst(KeyWord, Info, _Group) -> + case search_appname(KeyWord -- "##", Info) of + {ok,URL} -> + URL; + _ -> + warning("Can't substitute keyword ~s~n",[KeyWord]), + "" + end. + +search_appname(App, [{_Group,_,Apps} | Groups]) -> + case lists:keysearch(App, 1, Apps) of + {value, {_,[{_Vers,_Path,URL,_Text} | _]}} -> + {ok,lists:sublist(URL, length(URL) - length("/index.html"))}; + _ -> + search_appname(App, Groups) + end; +search_appname(_App, []) -> + {error,noapp}. + +subst_applinks(Info, Group) -> + subst_applinks_1(group_order(), Info, Group). + +subst_applinks_1([G|Gs], Info0, Group) -> + case lists:keysearch(G, 1, Info0) of + {value,{G,Heading,Apps}} -> + Info = lists:keydelete(G, 1, Info0), + ["\n<li>",Heading,"\n<ul>\n", + html_applinks(Apps),"\n</ul></li>\n"| + subst_applinks_1(Gs, Info, Group)]; + false -> + warning("No applications in group ~w\n", [G]), + subst_applinks_1(Gs, Info0, Group) + end; +subst_applinks_1([], [], _) -> []; +subst_applinks_1([], Info, _) -> + error("Info left:\n", [Info]), + []. + +html_applinks([{Name,[{_,_,URL,_}|_]}|AppNames]) -> + ["<li><a href=\"",URL,"\">",Name, + "</a></li>\n"|html_applinks(AppNames)]; +html_applinks([]) -> []. + + +% Info: [{Group,Heading,[{AppName,[{AppVersion,Path,URL,Text} | ..]} | ..]} ..] + +subst_groups(Info0) -> + {Html1,Info1} = subst_known_groups(group_order(), Info0, ""), + {Html2,Info} = subst_unknown_groups(Info1, Html1, []), + Fun = fun({_Group,_GText,Applist}, Acc) -> Applist ++ Acc end, + case lists:foldl(Fun, [], Info) of + [] -> + Html2; + Apps -> + [Html2,group_table("Misc Applications",Apps)] + end. + + +subst_known_groups([], Info, Text) -> + {Text,Info}; +subst_known_groups([Group | Groups], Info0, Text0) -> + case lists:keysearch(Group, 1, Info0) of + {value,{_,Heading,Apps}} -> + Text = group_table(Heading,Apps), + Info = lists:keydelete(Group, 1, Info0), + subst_known_groups(Groups, Info, Text0 ++ Text); + false -> + warning("No applications in group ~w~n",[Group]), + subst_known_groups(Groups, Info0, Text0) + end. + + +subst_unknown_groups([], Text0, Left) -> + {Text0,Left}; +subst_unknown_groups([{Group,"",Apps} | Groups], Text0, Left) -> + warning("No text describes ~w",[Group]), + subst_unknown_groups(Groups, Text0, [{Group,"",Apps} | Left]); +subst_unknown_groups([{_Group,Heading,Apps} | Groups], Text0, Left) -> + Text = group_table(Heading,Apps), + subst_unknown_groups(Groups, Text0 ++ Text, Left). + + +group_table(Heading,Apps) -> + [ + " <tr>\n", + " <td colspan=2 class=header>\n", + " <font size=\"+1\"><b>",Heading,"</b></font>\n", + " </td>\n", + " </tr>\n", + subst_apps(Apps), + " <tr>\n", + " <td colspan=2><font size=1> </font></td>\n", + " </tr>\n" + ]. + +% Count and split the applications in half to get the right sort +% order in the table. + +subst_apps([{App,VersionInfo} | Apps]) -> + [subst_app(App, VersionInfo) | subst_apps(Apps)]; +subst_apps([]) -> + []. + + +subst_app(App, [{VSN,_Path,Link,Text}]) -> + [ + " <tr class=app>\n", + " <td align=left valign=top>\n", + " <table border=0 width=\"100%\" cellspacing=0 cellpadding=0>\n", + " <tr class=app>\n", + " <td align=left valign=top>\n", + " <a href=\"",Link,"\" target=\"_top\">",uc(App),"</a>\n", + " <a href=\"",Link,"\" target=\"_top\">",VSN,"</a>\n", + " </td>\n", + " </tr>\n", + " </table>\n" + " </td>\n", + " <td align=left valign=top>\n", + Text,"\n", + " </td>\n", + " </tr>\n" + ]; +subst_app(App, [{VSN,_Path,Link,Text} | VerInfos]) -> + [ + " <tr class=app>\n", + " <td align=left valign=top>\n", + " <table border=0 width=\"100%\" cellspacing=0 cellpadding=0>\n", + " <tr class=app>\n", + " <td align=left valign=top>\n", + " <a href=\"",Link,"\" target=\"_top\">",uc(App), + "</a> <br>\n", + " <a href=\"",Link,"\" target=\"_top\">",VSN,"</a>\n", + " </td>\n", + " <td align=right valign=top width=50>\n", + " <table border=0 width=40 cellspacing=0 cellpadding=0>\n", + " <tr class=app>\n", + " <td align=left valign=top class=appnums>\n", + subst_vsn(VerInfos), + " </td>\n", + " </tr>\n", + " </table>\n" + " </td>\n", + " </tr>\n", + " </table>\n" + " </td>\n", + " <td align=left valign=top>\n", + Text,"\n", + " </td>\n", + " </tr>\n" + ]. + + +subst_vsn([{VSN,_Path,Link,_Text} | VSNs]) -> + [ + " <font size=\"2\"><a class=anum href=\"",Link,"\" target=\"_top\">", + VSN, + "</a></font><br>\n", + subst_vsn(VSNs) + ]; +subst_vsn([]) -> + "". + + +% Yes, this is very inefficient an is done for every comarision +% in the sort but it doesn't matter in this case. + +vsncmp({Vsn1,_,_,_}, {Vsn2,_,_,_}) -> + L1 = [list_to_integer(N1) || N1 <- string:tokens(Vsn1, ".")], + L2 = [list_to_integer(N2) || N2 <- string:tokens(Vsn2, ".")], + L1 > L2. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% GENERIC FUNCTIONS, NOT SPECIFIC FOR GENERATING INDEX.HTML +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Read the "info" file into a list of Key/Value pairs +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +read_info(File) -> + case file:open(File, read) of + {ok,Stream} -> + Res = + case file:read(Stream,10000) of + {ok, Text} -> + Lines = string:tokens(Text, "\n\r"), + KeyValues0 = lines_to_key_value(Lines), + combine_key_value(KeyValues0); + {error, Reason} -> + {error, Reason} + end, + file:close(Stream), + Res; + {error,Reason} -> + {error,Reason} + end. + +combine_key_value([{Key,Value1},{Key,Value2} | KeyValues]) -> + combine_key_value([{Key,Value1 ++ "\n" ++ Value2} | KeyValues]); +combine_key_value([KeyValue | KeyValues]) -> + [KeyValue | combine_key_value(KeyValues)]; +combine_key_value([]) -> + []. + +lines_to_key_value([]) -> + []; +lines_to_key_value([Line | Lines]) -> + case regexp:first_match(Line, "^[a-zA-Z_\\-]+:") of + nomatch -> + case regexp:first_match(Line, "[\041-\377]") of + nomatch -> + lines_to_key_value(Lines); + _ -> + warning("skipping line \"~s\"",[Line]), + lines_to_key_value(Lines) + end; + {match, _, Length} -> + Value0 = lists:sublist(Line, Length+1, length(Line) - Length), + {ok, Value1, _} = regexp:sub(Value0, "^[ \t]*", ""), + {ok, Value, _} = regexp:sub(Value1, "[ \t]*$", ""), + Key = lists:sublist(Line, Length-1), + [{Key,Value} | lines_to_key_value(Lines)] + end. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Extensions to the 'regexp' module. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +is_match(Ex, Re) -> + case regexp:first_match(Ex, Re) of + {match, _, _} -> + true; + nomatch -> + false + end. + +%% -type gsub(String, RegExp, Fun, Acc) -> subres(). +%% Substitute every match of the regular expression RegExp with the +%% string returned from the function Fun(Match, Acc). Accept pre-parsed +%% regular expressions. Acc is an argument to the Fun. The Fun should return +%% a tuple {Replacement, NewAcc}. + +gsub(String, RegExp, Fun, Acc) when list(RegExp) -> + case regexp:parse(RegExp) of + {ok,RE} -> gsub(String, RE, Fun, Acc); + {error,E} -> {error,E} + end; +gsub(String, RE, Fun, Acc) -> + {match,Ss} = regexp:matches(String, RE), + {NewString, NewAcc} = sub_repl(Ss, Fun, Acc, String, 1), + {ok,NewString,NewAcc}. + + +% New code that uses fun for finding the replacement. Also uses accumulator +% to pass argument between the calls to the fun. +sub_repl([{St,L}|Ss], Fun, Acc0, S, Pos) -> + Match = string:substr(S, St, L), + {Rep, Acc} = Fun(Match, Acc0), + {Rs, NewAcc} = sub_repl(Ss, Fun, Acc, S, St+L), + {string:substr(S, Pos, St-Pos) ++ Rep ++ Rs, NewAcc}; +sub_repl([], _Fun, Acc, S, Pos) -> {string:substr(S, Pos), Acc}. + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Error and warnings +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +error(Format, Args) -> + io:format("ERROR: " ++ Format ++ "\n", Args), + exit(1). + +warning(Format, Args) -> + case get(silent) of + true -> ok; + _ -> io:format("WARNING: " ++ Format ++ "\n", Args) + end. + +report(Format, Args) -> + case get(silent) of + true -> ok; + _ -> io:format(Format ++ "\n", Args) + end. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Extensions to the 'string' module. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +uc(String) -> + lists:reverse(uc(String, [])). + +uc([], Acc) -> + Acc; +uc([H | T], Acc) when is_integer(H), [97] =< H, H =< $z -> + uc(T, [H - 32 | Acc]); +uc([H | T], Acc) -> + uc(T, [H | Acc]). diff --git a/system/doc/top/src/erlresolvelinks.erl b/system/doc/top/src/erlresolvelinks.erl index 8d277ad17a..a891b67421 120000..100644 --- a/system/doc/top/src/erlresolvelinks.erl +++ b/system/doc/top/src/erlresolvelinks.erl @@ -1 +1,144 @@ -../../../../internal_tools/integration/scripts/resolve_links/erlresolvelinks.erl
\ No newline at end of file +-module(erlresolvelinks). + +%% ------ VERY IMPORTANT ------ +%% +%% Original location for this file: +%% /clearcase/otp/internal_tools/integration/scripts/resolve_links/ +%% When updating this file, copy the source to +%% /usr/local/otp/patch/share/program/ +%% and place .beam files (compiled with correct release) in all +%% /usr/local/otp/patch/share/program/<release> +%% for releases >= R10B +%% +%% ---------------------------- + +-export([make/1, do_make/1, do_make/2, do_make/3]). +-include_lib("kernel/include/file.hrl"). + +-define(JAVASCRIPT_NAME, "erlresolvelinks.js"). + +make([RootDir]) -> + do_make(RootDir); +make([RootDir, DestDir]) -> + do_make(RootDir, DestDir); +make([RootDir, DestDir, Name]) -> + do_make(RootDir, DestDir, Name). + +do_make(RootDir) -> + DestDir = filename:join(RootDir, "doc"), + do_make(RootDir, DestDir). + +do_make(RootDir, DestDir) -> + do_make(RootDir, DestDir, ?JAVASCRIPT_NAME). + +do_make(RootDir, DestDir, Name) -> + %% doc/Dir + %% erts-Vsn + %% lib/App-Vsn + DocDirs0 = get_dirs(filename:join([RootDir, "doc"])), + DocDirs = lists:map(fun(Dir) -> + D = filename:join(["doc", Dir]), + {D, D} end, DocDirs0), + + ErtsDirs = latest_app_dirs(RootDir, ""), + AppDirs = latest_app_dirs(RootDir, "lib"), + + AllAppDirs = + lists:map( + fun({App, AppVsn}) -> {App, filename:join([AppVsn, "doc", "html"])} + end, ErtsDirs ++ AppDirs), + + AllDirs = DocDirs ++ AllAppDirs, + {ok, Fd} = file:open(filename:join([DestDir, Name]), [write]), + UTC = calendar:universal_time(), + io:fwrite(Fd, "/* Generated by ~s at ~w UTC */\n", + [atom_to_list(?MODULE), UTC]), + io:fwrite(Fd, "function erlhref(ups, app, rest) {\n", []), + io:fwrite(Fd, " switch(app) {\n", []), + lists:foreach( + fun({Tag, Dir}) -> + io:fwrite(Fd, " case ~p:\n", [Tag]), + io:fwrite(Fd, " location.href=ups + \"~s/\" + rest;\n", + [Dir]), + io:fwrite(Fd, " break;\n", []) + end, AllDirs), + io:fwrite(Fd, " default:\n", []), + io:fwrite(Fd, " location.href=ups + \"Unresolved\";\n", []), + io:fwrite(Fd, " }\n", []), + io:fwrite(Fd, "}\n", []), + file:close(Fd), + ok. + +get_dirs(Dir) -> + {ok, Files} = file:list_dir(Dir), + AFiles = + lists:map(fun(File) -> {File, filename:join([Dir, File])} end, Files), + lists:zf(fun is_dir/1, AFiles). + +is_dir({File, AFile}) -> + {ok, FileInfo} = file:read_file_info(AFile), + case FileInfo#file_info.type of + directory -> + {true, File}; + _ -> + false + end. + +latest_app_dirs(RootDir, Dir) -> + ADir = filename:join(RootDir, Dir), + RDirs0 = get_dirs(ADir), + RDirs1 = lists:filter(fun is_app_dir/1, RDirs0), + %% Build a list of {{App, VsnNumList}, AppVsn} + SDirs0 = + lists:map(fun(AppVsn) -> + [App, VsnStr] = string:tokens(AppVsn, "-"), + VsnNumList = vsnstr_to_numlist(VsnStr), + {{App, VsnNumList}, AppVsn} end, + RDirs1), + SDirs1 = lists:keysort(1, SDirs0), + App2Dirs = lists:foldr(fun({{App, _VsnNumList}, AppVsn}, Acc) -> + case lists:keymember(App, 1, Acc) of + true -> + Acc; + false -> + [{App, AppVsn}| Acc] + end + end, [], SDirs1), + lists:map(fun({App, AppVsn}) -> {App, filename:join([Dir, AppVsn])} end, + App2Dirs). + +is_app_dir(Dir) -> + case string:tokens(Dir, "-") of + [_Name, Rest] -> + is_vsnstr(Rest); + _ -> + false + end. + +is_vsnstr(Str) -> + case string:tokens(Str, ".") of + [_] -> + false; + Toks -> + lists:all(fun is_numstr/1, Toks) + end. + +is_numstr(Cs) -> + lists:all(fun(C) when $0 =< C, C =< $9 -> + true; + (_) -> + false + end, Cs). + +%% We know: + +vsnstr_to_numlist(VsnStr) -> + lists:map(fun(NumStr) -> list_to_integer(NumStr) end, + string:tokens(VsnStr, ".")). + + + + + + + diff --git a/system/doc/top/src/permuted_index.erl b/system/doc/top/src/permuted_index.erl deleted file mode 120000 index e65338a517..0000000000 --- a/system/doc/top/src/permuted_index.erl +++ /dev/null @@ -1 +0,0 @@ -../../../../internal_tools/integration/scripts/make_index/permuted_index.erl
\ No newline at end of file diff --git a/system/doc/top/templates/erlang.gif b/system/doc/top/templates/erlang.gif Binary files differdeleted file mode 100644 index 91fd4b9647..0000000000 --- a/system/doc/top/templates/erlang.gif +++ /dev/null diff --git a/system/doc/top/templates/first.html.src b/system/doc/top/templates/first.html.src deleted file mode 100644 index edef1c0e5c..0000000000 --- a/system/doc/top/templates/first.html.src +++ /dev/null @@ -1,104 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> - <title>Erlang/OTP #release# Documentation</title> - <style type="text/css"> -<!-- - BODY { background: white } - - BODY { font-family: Verdana, Arial, Helvetica, sans-serif } - TH { font-family: Verdana, Arial, Helvetica, sans-serif } - TD { font-family: Verdana, Arial, Helvetica, sans-serif } - P { font-family: Verdana, Arial, Helvetica, sans-serif } - - .header { background: #222; color: #fff } - .app { background: #ccc } ---> - </style> -</head> -<body bgcolor=white text="#000000" link="#0000ff" vlink="#ff00ff" - alink="#ff0000"> -<center> -<p> -<font size="+1">Welcome to Erlang/OTP, a complete<br> -development environment<br> -for concurrent programming.</font> -</p> -</center> -<br> -<br> -<br> -<p><b> -<font size"+1"> -Some hints that may get you started faster -</font> -</b></p> - -<ul> - -<li>In addition the the documentation here Erlang is described in the book -<a href="http://www.pragprog.com/titles/jaerlang" target="_top">"Programming Erlang"</a>, ISBN 978-1-934356-00-5 which we really recommend as a start.<br/ > -The complete language is also described in the <a href="reference_manual/part_frame.html" target="_top">Erlang Reference Manual</a>. An Erlang tutorial can be found in <a href="getting_started/part_frame.html" target="_top">Getting Started With Erlang</a>. -</li> -<li>Erlang/OTP is divided into a number of OTP <a -href="applications.html">applications</a>. An application normally contains -Erlang <a href="man_index.html">modules</a>. Some OTP applications, -such as the C interface <em>Erl_Interface</em>, are written in other languages and have no Erlang -modules. - -<p> -Note that functions that are not imported or prefixed with a module -name belong to the module -<a href="#kernel#/erlang.html" target="_top">erlang</a> -(in the <em>Kernel</em> application). -</p> -<p> -<li>On a Unix system you can view the manual pages from the command -line using -<pre> - % erl -man <module> -</pre> -<p> - -<li> You can of course use any editor you like to write Erlang -programs, but if you use Emacs there exists editing support such as -indentation, syntax highlighting, electric commands, module name -verification, comment support including paragraph filling, skeletons, -tags support and more. See the <a href="#tools#/index.html" -target="_top">Tools</a> application for details. -<p> -There is also an -<a href="http://erlide.sourceforge.net" target="_top"> -Erlang plugin (ErlIde) for Eclipse</a> if you prefer a more graphical -environment. ErlIde is under development and should at the time -of writing this be quite stable and useful. -<li>When developing with Erlang/OTP you usually test your programs -from the interactive shell (see <a href="getting_started/part_frame.html" -target="_top">Getting Started With Erlang</a>) where you can call individual -functions. There is also a number of tools available, such as the graphical <a -href="#debugger#/index.html" target="_top">Debugger</a>, the process -manager <a href="#pman#/index.html" target="_top">Pman</a> and table -viewer <a href="#tv#/index.html" target="_top">TV</a>. -<p> Also note that there are some shell features like history list -(control-p and control-n), inline editing (emacs key bindings) and -module and function name completion (tab) if the module is loaded. -<p> - -<li>OpenSource users can ask questions -and share experiences on the <a href="http://www.erlang.org/faq.html" -target="_top">Erlang questions mailing list</a>. <p> - -<li>Before asking a question you can browse the <a -href="http://www.erlang.org/pipermail/erlang-questions/" -target="_top">mailing list archive</a> and read the <a -href="http://www.erlang.org/faq/faq.html" target="_top">Frequently -Asked Questions</a>. <p> - -<li>Additional information and links of interest for Erlang programmers can be found on the Erlang Open Source site -<a href="http://www.erlang.org/" target="_top">http://www.erlang.org</a>. -<p> - -</ul> - -</body> -</html> diff --git a/system/doc/top/templates/flip_closed.gif b/system/doc/top/templates/flip_closed.gif Binary files differdeleted file mode 100755 index 9a27c7c25d..0000000000 --- a/system/doc/top/templates/flip_closed.gif +++ /dev/null diff --git a/system/doc/top/templates/flip_google.gif b/system/doc/top/templates/flip_google.gif Binary files differdeleted file mode 100755 index 3f0543c2bb..0000000000 --- a/system/doc/top/templates/flip_google.gif +++ /dev/null diff --git a/system/doc/top/templates/flip_open.gif b/system/doc/top/templates/flip_open.gif Binary files differdeleted file mode 100755 index 9dda60e73a..0000000000 --- a/system/doc/top/templates/flip_open.gif +++ /dev/null diff --git a/system/doc/top/templates/flip_static.gif b/system/doc/top/templates/flip_static.gif Binary files differdeleted file mode 100755 index 2b3ddb5382..0000000000 --- a/system/doc/top/templates/flip_static.gif +++ /dev/null diff --git a/system/doc/top/templates/flipmenu.js b/system/doc/top/templates/flipmenu.js deleted file mode 100755 index 92a5a58a06..0000000000 --- a/system/doc/top/templates/flipmenu.js +++ /dev/null @@ -1,342 +0,0 @@ -// ######################################################################
-
-// ## flipMenu 5.0.0 (c) J. Reijers
-// ## Last modifications: 23 March 2007
-
-// ######################################################################
-
-// ## Degree of indentation from the left.
- flipIndentation = "5px";
-
-// ## Padding inbetween menu items.
- flipVerticalPadding = "4px";
-
-// ## Margin between the left of the browser and the menu.
- flipLeftMargin = "16px";
-
-// ## Margin between the top of the browser and the menu.
- flipTopMargin = "10px";
-
-// ## Allow multiple menus to fold out without closing all the other open ones.
- flipOpenMultipleMenus = false;
-
-// ## Preserve the current state of the menu (requires cookies).
- flipSaveMenuState = true;
-
-// ## Use custom images for bullets
- flipImages = true;
-
-// ## Images to use (specify full path)
- flipImg_open = "flip_open.gif";
- flipImg_closed = "flip_closed.gif";
- flipImg_static = "flip_static.gif";
-
-// ## Initialise all flipMenus onload
- flipInitOnLoad = true;
-
-// ## Message to display in status bar while loading
- flipLoadingMessage = "Loading...";
-
-// ######################################################################
-
-function alterSize(someSize, alterAmount) {
- someSize = String(someSize);
- var tmpNr = parseFloat(someSize.replace(/\D/g, ""));
- var tmpChar = someSize.replace(/\d/g, "");
- return isNaN(tmpNr) ? someSize : ((tmpNr + alterAmount) + tmpChar);
-}
-
-isIE = (String(navigator.appVersion).indexOf("MSIE") > -1);
-if (!isIE) flipIndentation = alterSize(flipIndentation, -16);
-if (!isIE) flipLeftMargin = alterSize(flipLeftMargin, -16);
-
-document.write(
- "<style type=\"text/css\">" +
-
- "ul.flipMenu { margin-top: " + flipTopMargin + "; margin-left: " + flipLeftMargin + "; " + (flipImages ? "" : "list-style-type: none;") + " }" +
- "ul.flipMenu ul, ul.flipMenu li { padding-top: " + flipVerticalPadding + "; margin-left: " + flipIndentation + "; margin-right: 0px; " + (flipImages ? "" : "list-style-type: none;") + " }" +
-
- "li.flipFolderOpen { cursor: pointer; " + (flipImages ? "list-style-image: url(" + flipImg_open + ");" : "") + " }" +
- "li.flipFolderClosed { cursor: pointer; " + (flipImages ? "list-style-image: url(" + flipImg_closed + ");" : "") + " }" +
-
- "</style>"
-);
-
-if (flipImages) {
- aFlipPreloads = [];
- aFlipPreloads[0] = new Image;
- aFlipPreloads[0].src = flipImg_open;
- aFlipPreloads[1] = new Image;
- aFlipPreloads[1].src = flipImg_closed;
- aFlipPreloads[2] = new Image;
- aFlipPreloads[2].src = flipImg_static;
-}
-
-function addEvent(someObj, someEvent, someFunction) {
- if (someObj.addEventListener) { someObj.addEventListener(someEvent, someFunction, true); return true; } else if (someObj.attachEvent) return someObj.attachEvent("on" + someEvent, someFunction); else return false;
-}
-
-function openCloseFlip(theItem, newSetting, openParents) {
- if (theItem.flipID) {
- if (openParents) {
- var tmpItem = theItem;
- while (tmpItem.parentElement || tmpItem.parentNode) {
- tmpItem = (tmpItem.parentElement) ? tmpItem.parentElement : tmpItem.parentNode;
- openCloseFlip(tmpItem, newSetting);
- }
- }
- if ((theItem.className == "flipFolderOpen" && newSetting == "closed") || (theItem.className == "flipFolderClosed" && newSetting == "open")) {
- if (!theItem.childrenInitialised) {
- for (var j = 0; j < theItem.childNodes.length; j++) if (theItem.childNodes[j].nodeName == "UL" && !theItem.childNodes[j].initialised) initFlip(theItem.childNodes[j]);
- theItem.childrenInitialised = true;
- }
- theItem.getElementsByTagName("UL")[0].style.display = (newSetting == "open") ? "" : "none";
- theItem.className = newSetting == "open" ? "flipFolderOpen" : "flipFolderClosed";
- }
- }
-}
-
-function openFlip(theItem, openParents) {
- openCloseFlip(theItem, "open", openParents);
-}
-
-function closeFlip(theItem, closeParents) {
- openCloseFlip(theItem, "closed", closeParents);
-}
-
-function toggleFlip(theElement) {
- if (theElement.flipID) {
- var theItem = theElement;
- var isContained = true;
- } else {
- if (theElement && theElement.button > 0) return false;
- var theItem = (isIE) ? event.srcElement : theElement.target;
-
- var isContained = false;
- if (theItem.className == "flipFolderOpen" || theItem.className == "flipFolderClosed") isContained = true; else while (theItem.parentElement || theItem.parentNode) {
- if (theItem.className == "flipStatic" || theItem.className == "flipFolderOpen" || theItem.className == "flipFolderClosed") {
- isContained = (theItem.className == "flipFolderOpen" || theItem.className == "flipFolderClosed");
- break;
- }
- theItem = (theItem.parentElement) ? theItem.parentElement : theItem.parentNode;
- }
- }
-
- var toOpenFlip = (isContained && theItem.className == "flipFolderClosed");
-
- if (!flipOpenMultipleMenus && (toOpenFlip || theItem.className == "flipStatic")) {
- if (theItem.parentElement || theItem.parentNode) {
- var parentUL = (theItem.parentElement) ? theItem.parentElement : theItem.parentNode;
- for (var i = 0; i < parentUL.childNodes.length; i++) closeFlip(parentUL.childNodes[i]);
- }
- }
-
- if (isContained) {
- if (toOpenFlip) openFlip(theItem); else closeFlip(theItem);
- }
-}
-
-function setAllFlips(startElement, newSetting) {
- if (typeof startElement == "undefined") var startElement = document;
- if (typeof newSetting == "undefined") var newSetting = "closed";
-
- var aUL = startElement.getElementsByTagName("UL");
- for (var i = 0; i < aUL.length; i++) {
- var parentFlip = aUL[i].parentElement ? aUL[i].parentElement : aUL[i].parentNode;
- openCloseFlip(parentFlip, newSetting);
- }
-}
-
-function openAllFlips(startElement) {
- setAllFlips(startElement, "open");
-}
-
-function closeAllFlips(startElement) {
- setAllFlips(startElement, "closed");
-}
-
-function initFlip(startElement) {
- if (!document.createElement) return false;
-
- if (!startElement || !startElement.nodeName) {
- var aUL = document.getElementsByTagName("UL");
- for (var i = 0; i < aUL.length; i++) {
- if (flipLoadingMessage != "") window.status = flipLoadingMessage + " " + parseInt((i / (aUL.length - 1)) * 100, 10) + "%";
- var curUL = aUL[i];
- if (curUL.className == "flipMenu") {
- initFlip(curUL);
-
- // ## Fix text selecting problem in Mozilla
- curUL.onselectstart = new Function("return false");
- curUL.onmousedown = new Function("return false");
- curUL.onclick = new Function("return true");
- }
- }
-
- if (flipSaveMenuState) loadMenuState();
-
- if (flipLoadingMessage != "") window.status = "";
- return true;
- }
-
- if (startElement.className == "flipMenu") startElement.style.display = "";
-
- if (!startElement.childNodes || startElement.childNodes.length == 0) return false;
-
- if (typeof flipIDCur == "undefined") flipIDCur = 0;
- if (!startElement.initialised) {
- var aUL = startElement.getElementsByTagName("UL");
- for (var i = 0; i < aUL.length; i++) aUL[i].style.display = "none";
- }
-
- for (var i = 0; i < startElement.childNodes.length; i++) {
- var curNode = startElement.childNodes[i];
- if (curNode.nodeName == "LI") {
- flipIDCur++;
- curNode.flipID = flipIDCur;
-
- var nodeHasChildren = curNode.getElementsByTagName("UL").length > 0;
- if (nodeHasChildren) {
- if (flipImages && curNode.flipClosed) curNode.style.listStyleImage = "url(" + curNode.flipClosed + ")";
-
- if (curNode.className == null || curNode.className == "") curNode.className = "flipFolderClosed";
- } else {
- curNode.className = "flipStatic";
- if (flipImages && !curNode.style.listStyleImage) {
- if (!curNode.flipStatic) curNode.flipStatic = flipImg_static;
- curNode.style.listStyleImage = "url(" + curNode.flipStatic + ")";
- }
- }
-
- if (!curNode.flipOpen) curNode.flipOpen = flipImg_open;
- if (!curNode.flipClosed) curNode.flipClosed = flipImg_closed;
-
- if (curNode.flipIsOpen) openFlip(curNode);
- }
- }
-
- startElement.initialised = true;
-}
-
-function rootOfFlip(flipID, startElement) {
-
- function containsFlip(startElement, flipID) {
- var flipFound = false;
- var i = 0;
- while (i < startElement.childNodes.length && !flipFound) {
- var curNode = startElement.childNodes[i];
- flipFound = (curNode.flipID == flipID) ? true : containsFlip(curNode, flipID);
- i++;
- }
- return flipFound;
- }
-
- var rootFlip = null;
-
- if (!startElement || !startElement.nodeName) {
- var aUL = document.getElementsByTagName("UL");
- var i = 0;
- while (rootFlip == null && i < aUL.length) {
- var curUL = aUL[i];
- if (curUL.nodeName == "UL" && curUL.className == "flipMenu") rootFlip = rootOfFlip(flipID, curUL);
- i++;
- }
- return rootFlip;
- }
-
- if (startElement.childNodes) for (var i = 0; i < startElement.childNodes.length; i++) {
- var curNode = startElement.childNodes[i];
- if (curNode.flipID == flipID || containsFlip(curNode, flipID)) rootFlip = curNode;
- }
-
- return rootFlip;
-}
-
-function getCookie(cookieName) {
- var allCookies = document.cookie;
- var indexStr = allCookies.indexOf(cookieName + "=");
- if (indexStr == -1) return "";
- indexStr = allCookies.indexOf("=", indexStr) + 1;
- var endStr = allCookies.indexOf(";", indexStr);
- if (endStr == -1) endStr = allCookies.length;
- return unescape(allCookies.substring(indexStr, endStr));
-}
-
-function inArray(someID, someArray) {
- for (var i = 0; i < someArray.length; i++) if (someArray[i] == someID) return true;
- return false;
-}
-
-function getMenuState(startElement) {
- if (!startElement.childNodes || startElement.childNodes.length == 0) return "";
-
- var openItems = "";
- var aUL = startElement.getElementsByTagName("UL");
- for (var i = 0; i < aUL.length; i++) {
- var curNode = aUL[i];
- var parentFlip = (curNode.parentElement) ? curNode.parentElement : curNode.parentNode;
- if (curNode.style.display == "" && parentFlip.flipID) openItems += " " + parentFlip.flipID;
- }
- return openItems;
-}
-
-function putMenuState(startElement) {
- if (!startElement.childNodes || startElement.childNodes.length == 0) return false;
-
- var aUL = startElement.getElementsByTagName("UL");
- for (var i = 0; i < aUL.length; i++) {
- var curNode = aUL[i];
- var parentFlip = (curNode.parentElement) ? curNode.parentElement : curNode.parentNode;
- if (inArray(parentFlip.flipID, aOpenItems)) {
- openFlip(parentFlip);
- if (typeof prevFlipRoot == "undefined") {
- var testRoot = rootOfFlip(parentFlip.flipID);
- if (testRoot.flipID == parentFlip.flipID) prevFlipRoot = testRoot;
- }
- }
- }
-}
-
-function saveMenuState() {
- if (flipSaveMenuState) {
- var aUL = document.getElementsByTagName("UL");
- for (var i = 0; i < aUL.length; i++) {
- var curUL = aUL[i];
- var curID = curUL.id ? curUL.id : i;
- if (curUL.className == "flipMenu") document.cookie = cookiePrefix + curID + "=" + getMenuState(curUL) + ";";
- }
- }
-}
-
-function loadMenuState() {
- var aUL = document.getElementsByTagName("UL");
- for (var i = 0; i < aUL.length; i++) {
- var curUL = aUL[i];
- var curID = curUL.id ? curUL.id : i;
- if (curUL.className == "flipMenu") {
- var savedState = String(getCookie(cookiePrefix + curID));
- if (savedState != "") {
- aOpenItems = savedState.split(" ");
- putMenuState(curUL);
- }
- }
- }
-
- addEvent(window, "unload", saveMenuState);
-}
-
-function clearMenuState(flipMenuID) {
- if (typeof flipMenuID == "undefined") {
- var aUL = document.getElementsByTagName("UL");
- for (var i = 0; i < aUL.length; i++) {
- var curUL = aUL[i];
- var curID = curUL.id ? curUL.id : i;
- if (curUL.className == "flipMenu") document.cookie = cookiePrefix + curID + "=;";
- }
- } else document.cookie = cookiePrefix + flipMenuID + "=;";
-}
-
-cookiePrefix = document.location.pathname + "_";
-
-addEvent(document, "click", toggleFlip);
-if (flipInitOnLoad) addEvent(window, "load", initFlip);
diff --git a/system/doc/top/templates/index.html.src b/system/doc/top/templates/index.html.src index 935bb11c80..257a656316 100644 --- a/system/doc/top/templates/index.html.src +++ b/system/doc/top/templates/index.html.src @@ -2,7 +2,7 @@ <!-- %CopyrightBegin% -Copyright Ericsson AB 2001-2009. All Rights Reserved. +Copyright Ericsson AB 2009-2010. All Rights Reserved. The contents of this file are subject to the Erlang Public License, Version 1.1, (the "License"); you may not use this file except in @@ -169,7 +169,7 @@ Asked Questions</a>. <p> <center> <small> -Copyright © 1999-2009 +Copyright © 1999-2010 <a href="http://www.ericsson.com">Ericsson AB</a> </small> </center> diff --git a/system/doc/top/templates/otp_top.css b/system/doc/top/templates/otp_top.css deleted file mode 100644 index 1c6d27bd8d..0000000000 --- a/system/doc/top/templates/otp_top.css +++ /dev/null @@ -1,53 +0,0 @@ - BODY { background: white } - - BODY { font-family: Verdana, Arial, Helvetica, sans-serif } - TH { font-family: Verdana, Arial, Helvetica, sans-serif } - TD { font-family: Verdana, Arial, Helvetica, sans-serif } - P { font-family: Verdana, Arial, Helvetica, sans-serif } - - .header { background: #222; color: #fff } - .top { background: #efe } - .otp { background: #efe } - .erlang { background: #ffe } - .otp2 { background: #efe } - .app { background: #ffe } - - a:link { color: blue; text-decoration: none } - a:active { color: blue; text-decoration: none } - a:visited { color: blue; text-decoration: none } - body { - margin: 0; - padding: 0; - border: 0; - overflow: scroll; - height: 100%; - max-height: 100% - } - #container { - width: 100%; - margin: 10px auto; - background-color: #fff; - } - #leftnav { - float: left; - width: 200px; - margin: 0; - padding: 1em; - } - #content { - margin-left: 220px; /* set left value to WidthOfFrameDiv */ - border-left: 1px solid red; - } - - .innertube { - margin: 15px; /* Magins for inner DIV inside each DIV (to provide padding) */ - } - - * html body{ /* IE6 hack */ - padding: 0 0 0 200px; /* Set value to (0 0 0 WidthOfFrameDiv)*/ - } - * html #maincontent{ /* IE6 hack*/ - height: 100%; - width: 100%; - } - diff --git a/system/doc/top/templates/system.html.src b/system/doc/top/templates/system.html.src deleted file mode 100644 index 761bc96ed0..0000000000 --- a/system/doc/top/templates/system.html.src +++ /dev/null @@ -1,281 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> - <title>Erlang/OTP #release#</title> - <style type="text/css"> -<!-- - BODY { background: white } - - BODY { font-family: Verdana, Arial, Helvetica, sans-serif } - TH { font-family: Verdana, Arial, Helvetica, sans-serif } - TD { font-family: Verdana, Arial, Helvetica, sans-serif } - P { font-family: Verdana, Arial, Helvetica, sans-serif } - - .header { background: #222; color: #fff } - .app { background: #ccc } - - a.anum:link { color: green; text-decoration: none } - a.anum:active { color: green; text-decoration: none } - a.anum:visited { color: green; text-decoration: none } - - a:link { text-decoration: none } - a:active { text-decoration: none } - a:visited { text-decoration: none } ---> - </style> -</head> - -<body bgcolor=white text="#000000" link="#0000ff" vlink="#ff00ff" - alink="#ff0000"> -<center> -<table border=0 width="90%" cellspacing=3 cellpadding=5> - - <tr> - <td colspan=2 class=header> - <font size="+1"><b>General</b></font> - </td> - </tr> - - <tr class=app> - <td align=left valign=top> - <table border=0 width="100%" cellspacing=0 cellpadding=0> - <tr class=app> - <td align=left valign=top> - <a href="system_architecture_intro/part_frame.html" target="_top" - name=system_architecture_intro> - Introduction - </a> - </td> - <td align=right valign=top width=50> - </td> - </tr> - </table> - </td> - <td align=left valign=top> -About Erlang, OTP, Erlang/OTP and this documentation - </td> - </tr> - - <tr class=app> - <td align=left valign=top> - <table border=0 width="100%" cellspacing=0 cellpadding=0> - <tr class=app> - <td align=left valign=top> - <a href="installation_guide/part_frame.html" target="_top" - name=installation_guide> - Installation Guide - </a> - </td> - <td align=right valign=top width=50> - </td> - </tr> - </table> - </td> - <td align=left valign=top> -The Erlang/OTP Installation Guide - </td> - </tr> - - <tr class=app> - <td align=left valign=top> - <table border=0 width="100%" cellspacing=0 cellpadding=0> - <tr class=app> - <td align=left valign=top> - <a href="system_principles/part_frame.html" target="_top" - name=system_principles> - System Principles - </a> - </td> - <td align=right valign=top width=20> - </td> - </tr> - </table> - </td> - <td align=left valign=top> -Starting, stopping and configuring the Erlang runtime system - </td> - </tr> - - <tr class=app> - <td align=left valign=top> - <table border=0 width="100%" cellspacing=0 cellpadding=0> - <tr class=app> - <td align=left valign=top> - <a href="embedded/part_frame.html" target="_top" name=embedded> - Embedded System - </a> - </td> - <td align=right valign=top width=50> - </td> - </tr> - </table> - </td> - <td align=left valign=top> -Erlang in an Embedded System - </td> - </tr> - - <tr> - <td colspan=2><font size=1> </font></td> - </tr> - -<!-- ====================================================================== --> - - <tr> - <td colspan=2 class=header> - <font size="+1"><b>Programming in Erlang</b></font> - </td> - </tr> - - <tr class=app> - <td align=left valign=top> - <table border=0 width="100%" cellspacing=0 cellpadding=0> - <tr class=app> - <td align=left valign=top> - <a href="reference_manual/part_frame.html" target="_top" name=reference_manual> - Erlang Reference Manual - </a> - </td> - <td align=right valign=top width=50> - </td> - </tr> - </table> - </td> - <td align=left valign=top> -Description of data types, language constructs and more - </td> - </tr> - - <tr class=app> - <td align=left valign=top> - <table border=0 width="100%" cellspacing=0 cellpadding=0> - <tr class=app> - <td align=left valign=top> - <a href="getting_started/part_frame.html" target="_top" name=getting_started> - Getting Started - </a> - </td> - <td align=right valign=top width=50> - </td> - </tr> - </table> - </td> - <td align=left valign=top> -Getting started with Erlang - </td> - </tr> - - <tr class=app> - <td align=left valign=top> - <table border=0 width="100%" cellspacing=0 cellpadding=0> - <tr class=app> - <td align=left valign=top> - <a href="programming_examples/part_frame.html" target="_top" name=programming_examples> - Programming Examples - </a> - </td> - <td align=right valign=top width=50> - </td> - </tr> - </table> - </td> - <td align=left valign=top> -Examples of using records, funs, list comprehensions and the bit syntax - </td> - </tr> - - <tr class=app> - <td align=left valign=top> - <table border=0 width="100%" cellspacing=0 cellpadding=0> - <tr class=app> - <td align=left valign=top> - <a href="efficiency_guide/part_frame.html" target="_top" name=efficiency_guide>Efficiency Guide</a> - </td> - <td align=right valign=top width=20> - </td> - </tr> - </table> - </td> - <td align=left valign=top> -Learn how to write efficient programs in Erlang - </td> - </tr> - - <tr class=app> - <td align=left valign=top> - <table border=0 width="100%" cellspacing=0 cellpadding=0> - <tr class=app> - <td align=left valign=top> - <a href="tutorial/part_frame.html" target="_top" name=tutorial>Interoperability Tutorial</a> - </td> - <td align=right valign=top width=20> - </td> - </tr> - </table> - </td> - <td align=left valign=top> -About interoperating with programs written in other programming languages - </td> - </tr> - - <tr> - <td colspan=2><font size=1> </font></td> - </tr> - -<!-- ====================================================================== --> - - <tr> - <td colspan=2 class=header> - <font size="+1"><b>Working with OTP</b></font> - </td> - </tr> - - <tr class=app> - <td align=left valign=top> - <table border=0 width="100%" cellspacing=0 cellpadding=0> - <tr class=app> - <td align=left valign=top> - <a href="design_principles/part_frame.html" target="_top" - name=design_principles> - Design Principles - </a> - </td> - <td align=right valign=top width=20> - </td> - </tr> - </table> - </td> - <td align=left valign=top> -Structure your programs with applications, supervisors and generic behaviors (gen_server, gen_event and gen_fsm). -Also use the built in error logger. - </td> - </tr> - - <tr class=app> - <td align=left valign=top> - <table border=0 width="100%" cellspacing=0 cellpadding=0> - <tr class=app> - <td align=left valign=top> - <a href="oam/part_frame.html" target="_top" name=oam>OAM Principles</a> - </td> - <td align=right valign=top width=20> - </td> - </tr> - </table> - </td> - <td align=left valign=top> -OTP Operation and Management Principles - </td> - </tr> - - <tr> - <td colspan=2><font size=1> </font></td> - </tr> - -</table> - -</center> -</body> -</html> - - diff --git a/system/doc/top/templates/toc_.html.src b/system/doc/top/templates/toc_.html.src deleted file mode 100644 index 5e79bc0ac8..0000000000 --- a/system/doc/top/templates/toc_.html.src +++ /dev/null @@ -1,105 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> - <title>Erlang/OTP #release#</title> - <style type="text/css"> -<!-- - BODY { background: white } - - BODY { font-family: Verdana, Arial, Helvetica, sans-serif } - TH { font-family: Verdana, Arial, Helvetica, sans-serif } - TD { font-family: Verdana, Arial, Helvetica, sans-serif } - P { font-family: Verdana, Arial, Helvetica, sans-serif } - - .header { background: #222; color: #fff } - .top { background: #efe } - .otp { background: #efe } - .erlang { background: #ffe } - .otp2 { background: #efe } - .app { background: #ffe } - - a:link { color: blue; text-decoration: none } - a:active { color: blue; text-decoration: none } - a:visited { color: blue; text-decoration: none } ---> - </style> -</head> - -<body bgcolor=white text="#000000" link="#0000ff" vlink="#ff00ff" - alink="#ff0000"> -<center> -<font size="+1"><b>Erlang/OTP #release#</b></font><br> -</center> - -<div class=top> -<small><a href="glossary.html" target=body>Glossary</a> | -<a href="man_index.html" target=body>Modules</a> | -<a href="permuted_index/pidxa.html" target=body>Index</a></small> -<p> -<small><a href="highlights.html" target=body>Release highlights</a><br> -<a href="incompatible.html" target=body>Potential incompatibilities</a> -</small> -</div> - -<p> -<div class=otp> -Erlang/OTP -<br> -·<small><a href="installation_guide/part_frame.html" target="_top" - name=installation_guide>Installation Guide</a></small> - -<br> -·<small><a href="system_principles/part_frame.html" target="_top" - name=system_principles>System Principles</a></small> - -<br> -·<small><a href="embedded/part_frame.html" target="_top" name=embedded>Embedded System</a></small> - -</div> - -<p> -<div class=erlang> -Erlang Programming -<br> -·<small><a href="getting_started/part_frame.html" target="_top" name=getting_started>Getting -Started</a></small> - -<br> -·<small><a href="reference_manual/part_frame.html" target="_top" name=reference_manual>Erlang -Reference Manual</a></small> - -<br> -·<small><a href="programming_examples/part_frame.html" target="_top" name=programming_examples>Programming -Examples</a></small> - -<br> -·<small><a href="efficiency_guide/part_frame.html" target="_top" name=efficiency_guide>Efficiency Guide</a></small> - -<br> -·<small><a href="tutorial/part_frame.html" target="_top" name=tutorial>Interoperability Tutorial</a></small> -</div> - -<p> -<div class=otp2> -Working with OTP -<br> -·<small><a href="design_principles/part_frame.html" target="_top" - name=design_principles>Design Principles</a> -</small> - -<br> -·<small><a href="oam/part_frame.html" target="_top" name=oam>OAM Principles</a></small> - -</div> - -<p> -<div class=app> -Applications -<small>#applinks#</small> -</div> - -<p> -<a href="http://www.erlang.se/" target=body>http://www.erlang.se</a> - -</body> -</html> |