| App::FuguWeb::Index(3p) | Perl Library Manual | App::FuguWeb::Index(3p) |
NAME
App::FuguWeb::Index - the body of the manual index
SYNOPSIS
use App::FuguWeb::Index;
my $index = App::FuguWeb::Index->new(config => $config, lang => 'de');
print $index->body('Handbuch', $opening, body_lang => 'en');
DESCRIPTION
The index lists every manual of the site, grouped and described. The groups follow the source directories, which is already how a tree is organized, so the index cannot drift when a manual is added: no list here names one.
The index does not retype a description either. It asks each App::FuguWeb::Manual, and that reads the source.
The index writes no prose of its own. The title, the opening and each heading come from the description, and each description comes from a source.
METHODS
new
App::FuguWeb::Index->new(config => $config, lang => $code)
"config" is an App::FuguWeb::Config and is required. "lang" is the code of the language of the page, and it defaults to "en".
body
$index->body($title, $opening,
title_lang => 'en',
body_lang => 'en')
The body fragment. App::FuguWeb::Page wraps it, exactly as it wraps a body fragment that a project wrote by hand.
The fragment opens with the title as its "<h1>", and then the opening as it stands. The caller passes the title and the "body" of the index page for the language of the page, so the heading and the browser tab always agree. A page with no "body" passes "undef", and the groups then follow the heading.
Each group then emits an "<h2>", one "<dl>", and one blank line. The "id" of the heading is the group name, and its text is the heading of the language. A group with no manual emits nothing, so an empty group leaves no heading behind.
Each manual of the language emits a term and a definition. The description comes from the source of that language.
<dt><a href="./Fugu::Daemon.3p.html">Fugu::Daemon(3p)</a></dt>
<dd>daemonize a process the OpenBSD way</dd>
The "./" is mandatory. A browser reads a relative URL whose first segment holds a colon as a scheme, so a bare Fugu::Daemon.3p.html would be read as the "fugu:" protocol.
The parts of the page come from the sources of more than one language: the title, the opening, each heading and each description. A part from a source of another language than the page carries that code as "lang" on its own element, per WEB-LANG-6. That element is the "<h1>" of the title, one "<div>" around the opening, the "<h2>" of a heading, or the "<dd>" of a description. A part of the language of the page carries no "lang", because the "<html>" element carries that code.
"title_lang" and "body_lang" are the languages of the title and of the opening. The caller passes the "title_lang" and the "lang" of the page, as "pages" in App::FuguWeb::Config names them. Each one defaults to the language of the page. The group gives the language of each heading, and the manual the language of each description.
SEE ALSO
App::FuguWeb, App::FuguWeb::Config, App::FuguWeb::Manual, App::FuguWeb::Page
AUTHOR
Dick Olsson <hi@senzilla.io>
| 2026-10-21 | OpenBSD |