%% ``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 expressed 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-2000, Ericsson %% Utvecklings AB. All Rights Reserved.'' %% %% $Id$ %% -module(docb_html_layout). -export([report_top/2, report_bot/1, first_top/2, first_bot/1, ref_top/2, ref_bot/1, chapter_top/2, chapter_bot/1, application_toc_top/3, application_toc_top/4, part_toc_top/3, part_toc_top/4, part_toc_bot/0, index_top/1, index_bot/0]). %% Report report_top(Data, Opts) -> [Title, Prepared, _Responsible, DocNo, _Approved, _Checked, _Date, Vsn0, _File] = Data, html_header(Title, Opts) ++ docb_util:html_snippet(top, Opts) ++ "

" ++ Title ++ "

" ++ DocNo ++ version(Opts, Vsn0) ++ "
" ++ Prepared ++ "
". report_bot(Opts) -> docb_util:html_snippet(bottom, Opts) ++ " ". %% First first_top(Data, Opts) -> [Title, _Prepared, _Responsible, DocNo, _Approved, _Checked, _Date, Vsn0, _File] = Data, html_header(Title, Opts) ++ docb_util:html_snippet(top, Opts) ++ "

" ++ Title ++ "

" ++ DocNo ++ version(Opts, Vsn0) ++ "
". first_bot(Opts) -> report_bot(Opts). %% Reference ref_top(Data, Opts) -> [Title, _Prepared, _Responsible, _DocNo, _Approved, _Checked, _Date, _Rev, _File] = Data, ref_html_header(Title, Opts) ++ "\n" ++ docb_util:html_snippet(top, Opts) ++ "

" ++ Title ++ "

". ref_bot(Opts) -> docb_util:html_snippet(bottom, Opts) ++ " ". %% Chapter chapter_top(Data, Opts) -> [Title, _Prepared, _Responsible, _DocNo, _Approved, _Checked, _Date, _Rev, _File] = Data, html_header(Title, Opts) ++ docb_util:html_snippet(top, Opts). chapter_bot(Opts) -> report_bot(Opts). %% Application ToC application_toc_top(Data, DocName, Opts) -> [Title, _Prepared, _Responsible, DocNo, _Approved, _Checked, _Date, Vsn0, _File] = Data, html_header(Title, []) ++ "
" ++ Title ++ "

" ++ DocNo ++ version(Opts, Vsn0) ++ "

Bibliography | Glossary | Index | Cover" ++ top_index(Opts) ++ "

Table of Contents

". application_toc_top(Data, DocName, Opts, HRefTexts) -> [Title, _Prepared, _Responsible, DocNo, _Approved, _Checked, _Date, Vsn0, _File] = Data, html_header(Title, []) ++ "
" ++ docb_util:join( lists:map( fun({HRef, Text}) -> "" ++ Text ++ "" end, HRefTexts), " | ") ++ top_index(Opts) ++ "

" ++ Title ++ "

" ++ DocNo ++ version(Opts, Vsn0) ++ "

Bibliography | Glossary | Index | Cover

Table of Contents

". %% Part ToC part_toc_top(Data, DocName, Opts) -> [Title, _Prepared, _Responsible, DocNo, _Approved, _Checked, _Date, Vsn0, _File] = Data, html_header(Title, []) ++ "

" ++ Title ++ "

" ++ DocNo ++ version(Opts, Vsn0) ++ "

Bibliography | Glossary | Cover" ++ top_index(Opts) ++ "

Table of Contents

". part_toc_top(Data, DocName, Opts, HRefTexts) -> [Title, _Prepared, _Responsible, DocNo, _Approved, _Checked, _Date, Vsn0, _File] = Data, html_header(Title, []) ++ "

" ++ docb_util:join( lists:map( fun({HRef, Text}) -> "" ++ Text ++ "" end, HRefTexts), " | ") ++ top_index(Opts) ++ "

" ++ Title ++ "

" ++ DocNo ++ version(Opts, Vsn0) ++ "

Bibliography | Glossary | Cover

Table of Contents

". part_toc_bot() -> " ". %% Index index_top(_Data) -> ref_html_header("INDEX", []) ++ "

INDEX

Emphasized index entries refer to modules and Courier ditos to functions.\n

\n". index_bot() -> part_toc_bot(). %% Internal functions html_header(Title, Opts) -> Vsn = docb_util:version(), %%" " " ++ Title ++ " " ++ docb_util:html_snippet(head, Opts) ++ " ". ref_html_header(Title, Opts) -> Vsn = docb_util:version(), %%" " " ++ Title ++ " " ++ docb_util:html_snippet(head, Opts) ++ " ". version(Opts, Vsn0) -> case docb_util:lookup_option(vsn, Opts, Vsn0) of "" -> ""; Vsn -> " Version " ++ Vsn end. top_index(Opts) -> case docb_util:lookup_option(top, Opts) of false -> ""; TIFile -> " | Top" end.