App-Requirement-Arch
view release on metacpan or search on metacpan
lib/App/Requirement/Arch/HTML/Flat.pm view on Meta::CPAN
=item * %flat_document_structure - A reference to a structure to be used to generate the HTML document
=item * \%requirements - A reference to a hash containing requirements
=item * $title - The title of the generated HTML document
=item * $header - A string which will be inserted as-is in the HTML document, under the title
=item * $comment - A string that is inserted as a comment
=back
I<Returns>
=over 2
=item * $html - A string containing the HTML document
=back
=cut
my ($flat_document_structure, $requirements, $title, $header, $comment) = @_;
# Generate the index
my $page_index =
extract_from_flat_requirements
(
$flat_document_structure,
$requirements,
\&generate_categories_links,
\&generate_requirements_links
);
# Generate the contents
my $page_contents =
extract_from_flat_requirements
(
$flat_document_structure,
$requirements,
\&generate_categories_html,
\&generate_requirement_html
);
$title = 'No title set for this document!' unless ($title);
return <<"END_OF_HTML";
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<!-- $comment -->
<title>$title</title>
<style type="text/css">
body,form{
margin: 0;
margin-right: 15%;
}
pre {
background-color: #FFFFFF;
font-family: monospace;
font-size: 9pt;
color: #000000;
}
body {
background-color: #FFFFFF;
font-family: verdana,arial,helvetica,sans-serif;
font-size: 10pt;
color: #000000;
}
select {
font-size: 10pt;
font-family: Verdana,sans-serif;
}
h1{
font-size: 14pt;
}
h2{
font-size: 13pt;
}
h3 {
font-size: 12pt;
}
h4 {
font-size: 11pt;
}
h5 {
font-size: 10pt;
}
hr {
color: #003399;
height: 2px;
}
</style>
</head>
<body>
<h1>$title</h1>
<p>$header</p>
<h1>Index</h1>
<div style="margin-left: 3em;">
$page_index
</div>
<hr />
<div style="margin-left: 1em;">
$page_contents
</div>
<p><img src='http://www.w3.org/Icons/valid-xhtml10' height="15" width='44' /></p>
</body>
</html>
END_OF_HTML
}
#-----------------------------------------------------------------------------------------
sub transformt_text_to_html
{
=head2 transformt_text_to_html($string_to_htmlize)
Transform text elements to their HTML equivalent
I<Arguments>
=over 2
( run in 0.802 second using v1.01-cache-2.11-cpan-f56aa216473 )