HTML-Toc
view release on metacpan or search on metacpan
t/ManualTest/manualTest1.htm view on Meta::CPAN
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Manual</title>
<style type="text/css">
ul.toc_appendix1 {
list-style-type: none;
margin-left: 0;
margin-top: 1em;
margin-bottom: 1em;
}
t/anchors.t view on Meta::CPAN
The first heading text goes here<br />
<h1>The Big Step 2</h1>
This is the second heading text<br />
<h2>second header, first subheader</h2>
Some subheader text here<br />
<h2>second header, second subheader</h2>
Another piece of subheader text here<br />
<h1>The Big Step</h1>
Third text for heading h1 #3<br />
<h1>The Big Step #6</h1>
Per the XHTML 1.0 spec, the number/hash sign is NOT allowed in fragments; in practice, the fragment starts with the first hash.<br />
Such anchors also work in Firefox 3 and IE 6.<br />
<h1>Calculation #7: 7/5>3 or <2?</h1>
Hail the spec, http://www.w3.org/TR/REC-html40/types.html#type-name:
ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
<h1>#8: start with a number (hash) [pound] {comment} sign</h1>
<h1>Lots of gibberish here: “!”#$%&'()*+,-./:;<=>?@[\]^_`{|}~</h1>
Note how the straight quotes were replaced by smart quotes, which are invalid in id attributes for <span class="caps">XHTML</span> 1.0 (!)
HTML
$tocInsertor->insert($toc, $content, {output => \$output});
t/anchors.t view on Meta::CPAN
The first heading text goes here<br />
<h1><a name="The_Big_Step_2"></a>The Big Step 2</h1>
This is the second heading text<br />
<h2><a name="second_header.2C_first_subheader"></a>second header, first subheader</h2>
Some subheader text here<br />
<h2><a name="second_header.2C_second_subheader"></a>second header, second subheader</h2>
Another piece of subheader text here<br />
<h1><a name="The_Big_Step"></a>The Big Step</h1>
Third text for heading h1 #3<br />
<h1><a name="The_Big_Step_.236"></a>The Big Step #6</h1>
Per the XHTML 1.0 spec, the number/hash sign is NOT allowed in fragments; in practice, the fragment starts with the first hash.<br />
Such anchors also work in Firefox 3 and IE 6.<br />
<h1><a name="Calculation_.237:_7.2F5.3E3_or_.3C2.3F"></a>Calculation #7: 7/5>3 or <2?</h1>
Hail the spec, http://www.w3.org/TR/REC-html40/types.html#type-name:
ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
<h1><a name="L.238:_start_with_a_number_.28hash.29_.5Bpound.5D_.7Bcomment.7D_sign"></a>#8: start with a number (hash) [pound] {comment} sign</h1>
<h1><a name="Lots_of_gibberish_here:_.E2.80.9C.21.E2.80.9D.23.24.25.26.27.28.29.2A.2B.2C-..2F:.3B.3C.3D.3E.3F.40.5B.5C.5D.5E_.60.7B.7C.7D.7E"></a>Lots of gibberish here: “!”#$%&'()*+,-./:;<=>?@[\]^_`{|}~</h1>
Note how the straight quotes were replaced by smart quotes, which are invalid in id attributes for <span class="caps">XHTML</span> 1.0 (!)
EOT
t/manualTest.t view on Meta::CPAN
# Insert ToC
$tocInsertor->insertIntoFile(
[$toc, $tocOfFigures, $tocOfTables],
't/ManualTest/manualTest1.htm', {
'doUseGroupsGlobal' => 1,
'output' => \$output,
'outputFile' => 't/ManualTest/manualTest2.htm'
}
);
eq_or_diff($output, <<HTML, 'Test inserting ToC into manual', {max_width => 120});
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Manual</title>
<style type="text/css">
ul.toc_appendix1 {
list-style-type: none;
margin-left: 0;
margin-top: 1em;
margin-bottom: 1em;
}
t/manualTest.t view on Meta::CPAN
# Insert ToC
$tocUpdator->updateFile(
[$toc, $tocOfFigures, $tocOfTables],
't/ManualTest/manualTest1.htm', {
'doUseGroupsGlobal' => 1,
'output' => \$output,
'outputFile' => 't/ManualTest/manualTest3.htm'
}
);
eq_or_diff($output, <<HTML, 'Test inserting ToC into manual', {max_width => 120});
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Manual</title>
<style type="text/css">
ul.toc_appendix1 {
list-style-type: none;
margin-left: 0;
margin-top: 1em;
margin-bottom: 1em;
}
t/manualTest.t view on Meta::CPAN
# Insert ToC
$tocUpdator->updateFile(
[$toc, $tocOfFigures, $tocOfTables],
't/ManualTest/manualTest3.htm', {
'doUseGroupsGlobal' => 1,
'output' => \$output,
'outputFile' => 't/ManualTest/manualTest4.htm'
}
);
eq_or_diff($output, <<HTML, 'Test inserting ToC into manual', {max_width => 120});
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Manual</title>
<style type="text/css">
ul.toc_appendix1 {
list-style-type: none;
margin-left: 0;
margin-top: 1em;
margin-bottom: 1em;
}
( run in 0.668 second using v1.01-cache-2.11-cpan-49f99fa48dc )