summaryrefslogtreecommitdiffstats
path: root/libvpx/examples/includes/HTML-Toc-0.91/t
diff options
context:
space:
mode:
Diffstat (limited to 'libvpx/examples/includes/HTML-Toc-0.91/t')
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/ManualTest/manualTest1.htm92
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir1/SubSubDir1/index.htm5
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir1/index.htm5
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/SubSubDir1/index.htm5
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/SubSubDir2/index.htm5
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/index.htm5
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir3/index.htm5
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/index.htm5
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/extend.t87
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/format.t157
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/generate.t200
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/insert.t336
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/manualTest.t768
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/options.t194
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/podExamples.t709
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/propagate.t176
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/siteMap.t97
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/update.t114
18 files changed, 0 insertions, 2965 deletions
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/ManualTest/manualTest1.htm b/libvpx/examples/includes/HTML-Toc-0.91/t/ManualTest/manualTest1.htm
deleted file mode 100644
index 1bd250f..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/ManualTest/manualTest1.htm
+++ /dev/null
@@ -1,92 +0,0 @@
-<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;
- }
- ul.toc_h1 {
- list-style-type: none;
- margin-left: 1;
- margin-top: 1em;
- margin-bottom: 1em;
- }
- ul.toc_h2 {
- list-style-type: none;
- }
- ul.toc_h3 {
- list-style-type: none;
- }
- ul.toc_part1 {
- list-style-type: none;
- margin-left: 1;
- margin-top: 1em;
- margin-bottom: 1em;
- }
- ul.toc_prelude1 {
- list-style: none;
- }
- p.captionFigure {
- font-style: italic;
- font-weight: bold;
- }
- p.captionTable {
- font-style: italic;
- font-weight: bold;
- }
- </style>
-</head>
-<body>
-
-<h1 class=prelude>Preface</h1>
-Better C than never.
-
-<h1 class=hidden>Table of Contents</h1>
-<!-- Table of Contents -->
-
-<h1 class=prelude>Table of Figures</h1>
-<!-- Table of Figures -->
-
-<h1 class=prelude>Table of Tables</h1>
-<!-- Table of Tables -->
-
-<h1 class=prelude>Introduction</h1>
-Thanks to standardisation and the excellent work of the QWERTY corporation it is possible to learn C with almost any C manual.
-<p class=captionTable>Compile Steps</p>
-<ul><pre>
- Parser
- Compiler
- Linker
-</pre></ul>
-
-<h1 class=part>Disks</h1>
-<h1>Compiler Disk v1</h1>
-<img src=img.gif alt="Contents Compiler Disk v1">
-<p class=captionFigure>Contents Compiler Disk v1</p>
-
-<h2>System</h2>
-<h2>Standard Library</h2>
-
-<h1>Compiler Disk v2</h1>
-<img src=img.gif alt="Contents Compiler Disk v2">
-<p class=captionFigure>Contents Compiler Disk v2</p>
-
-<h2>System</h2>
-<h3>parser.com</h3>
-<h3>compiler.com</h3>
-<h3>linker.com</h3>
-<h2>Standard Library</h2>
-
-<h1>Library System Disk</h1>
-<h1 class=part>Personal</h1>
-<h1>Tips & Tricks</h1>
-<h1 class=part>Appendixes</h1>
-<h1 class=appendix>Functions Standard Library v1</h1>
-<h1 class=appendix>Functions Standard Library v2</h1>
-<h1 class=appendix>Functions Graphic Library</h1>
-<h1 class=prelude>Bibliography</h1>
-</body>
-</html>
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir1/SubSubDir1/index.htm b/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir1/SubSubDir1/index.htm
deleted file mode 100644
index 5288cde..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir1/SubSubDir1/index.htm
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<head>
-<title>SubSub1</title>
-</head>
-</html>
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir1/index.htm b/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir1/index.htm
deleted file mode 100644
index c938212..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir1/index.htm
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<head>
-<title>Sub1</title>
-</head>
-</html>
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/SubSubDir1/index.htm b/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/SubSubDir1/index.htm
deleted file mode 100644
index 5288cde..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/SubSubDir1/index.htm
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<head>
-<title>SubSub1</title>
-</head>
-</html>
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/SubSubDir2/index.htm b/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/SubSubDir2/index.htm
deleted file mode 100644
index eaadf8c..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/SubSubDir2/index.htm
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<head>
-<title>SubSub2</title>
-</head>
-</html>
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/index.htm b/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/index.htm
deleted file mode 100644
index 8445eb1..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/index.htm
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<head>
-<title>Sub2</title>
-</head>
-</html>
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir3/index.htm b/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir3/index.htm
deleted file mode 100644
index cf9aa99..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir3/index.htm
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<head>
-<title>Sub3</title>
-</head>
-</html>
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/index.htm b/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/index.htm
deleted file mode 100644
index 864b0b5..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/index.htm
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<head>
-<title>Main</title>
-</head>
-</html>
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/extend.t b/libvpx/examples/includes/HTML-Toc-0.91/t/extend.t
deleted file mode 100644
index fe9daee..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/extend.t
+++ /dev/null
@@ -1,87 +0,0 @@
-#--- generate.t ---------------------------------------------------------------
-# function: Test ToC generation.
-
-use strict;
-use Test;
-
-BEGIN { plan tests => 4; }
-
-use HTML::Toc;
-use HTML::TocGenerator;
-
-my ($filename);
-my $toc = HTML::Toc->new;
-my $tocGenerator = HTML::TocGenerator->new;
-
-$toc->setOptions({
- 'doLinkToToken' => 0,
- 'levelIndent' => 0,
- 'header' => '',
- 'footer' => '',
-});
-
-
-BEGIN {
- # Create test file
- $filename = "file$$.htm";
- die "$filename is already there" if -e $filename;
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT';
-<h1>Header</h1>
-EOT
- close(FILE);
-}
-
-
-END {
- # Remove test file
- unlink($filename) or warn "Can't unlink $filename: $!";
-}
-
-
-#--- 1. extend ----------------------------------------------------------------
-
- # Generate ToC
-$tocGenerator->generate($toc, "<h1>Header</h1>");
- # Extend ToC
-$tocGenerator->extend($toc, "<h1>Header</h1>");
- # Test ToC
-ok($toc->format(), "<ul>\n<li>Header\n<li>Header\n</ul>");
-
-
-#--- 2. extendFromFile --------------------------------------------------------
-
- # Generate ToC
-$tocGenerator->generateFromFile($toc, $filename);
- # Extend ToC
-$tocGenerator->extendFromFile($toc, $filename);
- # Test ToC
-ok($toc->format(), "<ul>\n<li>Header\n<li>Header\n</ul>");
-
-
-#--- 3. extendFromFiles -------------------------------------------------------
-
- # Generate ToC
-$tocGenerator->generateFromFile($toc, $filename);
- # Extend ToC
-$tocGenerator->extendFromFile($toc, [$filename, $filename]);
- # Test ToC
-ok($toc->format(), "<ul>\n<li>Header\n<li>Header\n<li>Header\n</ul>");
-
-
-#--- 4. linkTocToToken --------------------------------------------------------
-
-$toc->setOptions({
- 'doLinkToToken' => 1,
-});
- # Generate ToC
-$tocGenerator->generate($toc, "<h1>Header</h1>");
- # Extend ToC
-$tocGenerator->extend($toc, "<h1>Header</h1>");
- # Test ToC
-ok($toc->format() . "\n", <<'EOT');
-<ul>
-<li><a href=#h-1>Header</a>
-<li><a href=#h-2>Header</a>
-</ul>
-EOT
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/format.t b/libvpx/examples/includes/HTML-Toc-0.91/t/format.t
deleted file mode 100644
index 62d2b6c..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/format.t
+++ /dev/null
@@ -1,157 +0,0 @@
-#--- format.t -----------------------------------------------------------------
-# function: Test ToC formatting.
-
-use strict;
-use Test;
-
-BEGIN { plan tests => 6; }
-
-use HTML::Toc;
-use HTML::TocGenerator;
-use HTML::TocInsertor;
-
-my ($output, $content, $filename);
-my $toc = HTML::Toc->new;
-my $tocGenerator = HTML::TocGenerator->new;
-my $tocInsertor = HTML::TocInsertor->new;
-
-$toc->setOptions({
- 'doLinkToToken' => 0,
- 'levelIndent' => 0,
- 'insertionPoint' => 'before <h1>',
- 'header' => '',
- 'footer' => '',
-});
-
-
-BEGIN {
- # Create test file
- $filename = "file$$.htm";
- die "$filename is already there" if -e $filename;
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<h1>Header</h1>
-EOT
-}
-
-
-END {
- # Remove test file
- unlink($filename) or warn "Can't unlink $filename: $!";
-}
-
-
-#--- 1. templateLevelBegin ----------------------------------------------------
-
-$toc->setOptions({
- 'templateLevelBegin' => '"<ul class=toc_$groupId$level>\n"'
-});
-$tocInsertor->insert($toc, "<h1>Header</h1>", {'output' => \$output});
-ok($output, "<ul class=toc_h1>\n<li>Header\n</ul><h1>Header</h1>");
-$toc->setOptions({'templateLevelBegin' => undef});
-
-
-#--- 2. levelToToc -----------------------------------------------------------
-
-$tocGenerator->generate($toc, "<h1>Header1</h1>\n<h2>Header2</h2>");
-$toc->setOptions({'levelToToc' => '1'});
-ok($toc->format(), "<ul>\n<li>Header1\n</ul>");
-$toc->setOptions({'levelToToc' => '.*'});
-
-
-#--- 3. groupToToc -----------------------------------------------------------
-
-$toc->setOptions({
- 'tokenToToc' => [{
- 'level' => 1,
- 'tokenBegin' => '<h1 class=-foo>'
- }, {
- 'groupId' => 'foo',
- 'level' => 1,
- 'tokenBegin' => '<h1 class=foo>'
- }]
-});
-$tocGenerator->generate($toc, "<h1>Header1</h1>\n<h1 class=foo>Foo</h1>");
-$toc->setOptions({'groupToToc' => 'foo'});
-ok($toc->format(), "<ul>\n<li>Foo\n</ul>");
-$toc->setOptions({'groupToToc' => '.*'});
-
-
-#--- 4. header & footer -------------------------------------------------------
-
-$toc->setOptions({
- 'tokenToToc' => [{
- 'level' => 1,
- 'tokenBegin' => '<h1>'
- }],
- 'header' => '<!-- TocHeader -->',
- 'footer' => '<!-- TocFooter -->',
-});
-$tocInsertor->insert($toc, "<h1>Header1</h1>", {'output' => \$output});
-ok("$output\n", <<EOT);
-<!-- TocHeader --><ul>
-<li>Header1
-</ul><!-- TocFooter --><h1>Header1</h1>
-EOT
-
-
- # Test 'doSingleStepLevel' => 1
-TestSingleStepLevel1();
- # Test 'doSingleStepLevel' => 0
-TestSingleStepLevel0();
-
-
-#--- 5. TestSingleStepLevel1 --------------------------------------------------
-
-sub TestSingleStepLevel1 {
- my $toc = new HTML::Toc;
- my $tocGenerator = new HTML::TocGenerator;
-
- # Generate ToC
- $tocGenerator->generate($toc, <<EOT);
-<h1>Header 1</h1>
-<h3>Header 3</h3>
-EOT
- # Compare output
- ok($toc->format(), <<EOT);
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1>Header 1</a>
- <ul>
- <ul>
- <li><a href=#h-1.0.1>Header 3</a>
- </ul>
- </ul>
-</ul>
-<!-- End of generated Table of Contents -->
-EOT
-} # TestSingleStepLevel1()
-
-
-#--- 6. TestSingleStepLevel0 --------------------------------------------------
-
-sub TestSingleStepLevel0 {
- my $toc = new HTML::Toc;
- my $tocGenerator = new HTML::TocGenerator;
-
- # Set ToC options
- $toc->setOptions({'doSingleStepLevel' => 0});
- # Generate ToC
- $tocGenerator->generate($toc, <<EOT);
-<h1>Header 1</h1>
-<h3>Header 3</h3>
-EOT
- # Compare output
- ok($toc->format(), <<EOT);
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1>Header 1</a>
- <ul>
- <li><a href=#h-1.0.1>Header 3</a>
- </ul>
-</ul>
-<!-- End of generated Table of Contents -->
-EOT
-} # TestSingleStepLevel0()
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/generate.t b/libvpx/examples/includes/HTML-Toc-0.91/t/generate.t
deleted file mode 100644
index 869bdf4..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/generate.t
+++ /dev/null
@@ -1,200 +0,0 @@
-#--- generate.t ---------------------------------------------------------------
-# function: Test ToC generation.
-
-use strict;
-use Test;
-
-BEGIN { plan tests => 13; }
-
-use HTML::Toc;
-use HTML::TocGenerator;
-
-my ($filename);
-my $toc = HTML::Toc->new;
-my $tocGenerator = HTML::TocGenerator->new;
-
-$toc->setOptions({
- 'doLinkToToken' => 0,
- 'levelIndent' => 0,
- 'header' => '',
- 'footer' => '',
-});
-
-
-BEGIN {
- # Create test file
- $filename = "file$$.htm";
- die "$filename is already there" if -e $filename;
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT';
-<h1>Header</h1>
-EOT
- close(FILE);
-}
-
-
-END {
- # Remove test file
- unlink($filename) or warn "Can't unlink $filename: $!";
-}
-
-
-#--- 1. generate --------------------------------------------------------------
-
-$tocGenerator->generate($toc, "<h1>Header</h1>");
-ok($toc->format(), "<ul>\n<li>Header\n</ul>");
-
-
-#--- 2. generateFromFile ------------------------------------------------------
-
-$tocGenerator->generateFromFile($toc, $filename);
-ok($toc->format(), "<ul>\n<li>Header\n</ul>");
-
-
-#--- 3. generateFromFiles -----------------------------------------------------
-
-$tocGenerator->generateFromFile($toc, [$filename, $filename]);
-ok($toc->format(), "<ul>\n<li>Header\n<li>Header\n</ul>");
-
-
-#--- 4. doLinkToToken -----------------------------------------------------
-
-$toc->setOptions({'doLinkToToken' => 1});
-$tocGenerator->generateFromFile($toc, $filename, {'globalGroups' => 1});
-ok($toc->format(), "<ul>\n<li><a href=#h-1>Header</a>\n</ul>");
-
-
-#--- 5. doLinkToFile -------------------------------------------------------
-
-$toc->setOptions({'doLinkToFile' => 1});
-$tocGenerator->generateFromFile($toc, $filename);
-ok($toc->format(), "<ul>\n<li><a href=$filename#h-1>Header</a>\n</ul>");
-
-
-#--- 6. templateAnchorHrefBegin -----------------------------------------------
-
- # Set options
-$toc->setOptions({'templateAnchorHrefBegin' => '"test-$file"'});
- # Generate ToC
-$tocGenerator->generateFromFile($toc, $filename);
- # Test ToC
-ok($toc->format(), "<ul>\n<li>test-".$filename."Header</a>\n</ul>");
- # Reset options
-$toc->setOptions({'templateAnchorHrefBegin' => undef});
-
-
-#--- 7. templateAnchorHrefBegin function --------------------------------------
-
-sub AssembleAnchorHrefBegin {
- # Get arguments
- my ($aFile, $aGroupId, $aLevel, $aNode) = @_;
- # Return value
- return $aFile . $aGroupId . $aLevel . $aNode;
-} # AssembleAnchorHrefBegin()
-
-
- # Set options
-$toc->setOptions({'templateAnchorHrefBegin' => \&AssembleAnchorHrefBegin});
- # Generate ToC
-$tocGenerator->generateFromFile($toc, $filename);
- # Test ToC
-ok($toc->format(), "<ul>\n<li>".$filename."h11Header</a>\n</ul>");
- # Reset options
-$toc->setOptions({'templateAnchorHrefBegin' => undef});
-
-
-#--- 8. levelToToc no levels available ---------------------------------------
-
-$toc->setOptions({'levelToToc' => '2'});
-$tocGenerator->generate($toc, "<h1>Header</h1>");
-ok($toc->format(), "");
-
-
-#--- 9. levelToToc level 1 ---------------------------------------------------
-
- # Set options
-$toc->setOptions({
- 'levelToToc' => '1',
- 'doLinkToToken' => 0,
-});
-$tocGenerator->generate($toc, "<h1>Header1</h1>\n<h2>Header2</h2>");
-ok($toc->format(), "<ul>\n<li>Header1\n</ul>");
-
-
-#--- 10. levelToToc level 2 --------------------------------------------------
-
- # Set options
-$toc->setOptions({
- 'levelToToc' => '2',
- 'doLinkToToken' => 0,
-});
-$tocGenerator->generate($toc, "<h1>Header1</h1>\n<h2>Header2</h2>");
-ok($toc->format(), "<ul>\n<li>Header2\n</ul>");
- # Restore options
-$toc->setOptions({
- 'levelToToc' => '.*',
-});
-
-
-#--- 11. tokenToToc empty array ----------------------------------------------
-
- # Set options
-$toc->setOptions({'tokenToToc' => []});
-$tocGenerator->generate($toc, "<h1>Header</h1>");
-ok($toc->format(), "");
-
-
-#--- 12. groups nested --------------------------------------------------------
-
-$toc->setOptions({
- 'doNestGroup' => 1,
- 'tokenToToc' => [
- {
- 'level' => 1,
- 'tokenBegin' => '<h1 class=-appendix>'
- }, {
- 'groupId' => 'appendix',
- 'level' => 1,
- 'tokenBegin' => '<h1 class=appendix>'
- }
- ]
-});
-$tocGenerator->generate(
- $toc, "<h1>Header1</h1>\n<h1 class=appendix>Appendix</h1>"
-);
-ok($toc->format() . "\n", <<'EOT');
-<ul>
-<li>Header1
-<ul>
-<li>Appendix
-</ul>
-</ul>
-EOT
-
-
-#--- 13. groups not nested ----------------------------------------------------
-
-$toc->setOptions({
- 'doNestGroup' => 0,
- 'tokenToToc' => [
- {
- 'level' => 1,
- 'tokenBegin' => '<h1 class=-appendix>'
- }, {
- 'groupId' => 'appendix',
- 'level' => 1,
- 'tokenBegin' => '<h1 class=appendix>'
- }
- ]
-});
-$tocGenerator->generate(
- $toc, "<h1>Header1</h1>\n<h1 class=appendix>Appendix</h1>"
-);
-ok($toc->format() . "\n", <<'EOT');
-<ul>
-<li>Header1
-</ul>
-<ul>
-<li>Appendix
-</ul>
-EOT
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/insert.t b/libvpx/examples/includes/HTML-Toc-0.91/t/insert.t
deleted file mode 100644
index 3f1adba..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/insert.t
+++ /dev/null
@@ -1,336 +0,0 @@
-#--- insert.t -----------------------------------------------------------------
-# function: Test ToC insertion.
-
-use strict;
-use Test;
-
-BEGIN { plan tests => 10; }
-
-use HTML::Toc;
-use HTML::TocGenerator;
-use HTML::TocInsertor;
-
-my ($output, $content, $filename);
-my $toc = HTML::Toc->new;
-my $tocGenerator = HTML::TocGenerator->new;
-my $tocInsertor = HTML::TocInsertor->new;
-
-$toc->setOptions({
- 'doLinkToToken' => 0,
- 'levelIndent' => 0,
- 'header' => "",
- 'footer' => "",
-});
-
-
-BEGIN {
- # Create test file
- $filename = "file$$.htm";
- die "$filename is already there" if -e $filename;
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<h1>Header</h1>
-EOT
-}
-
-
-END {
- # Remove test file
- unlink($filename) or warn "Can't unlink $filename: $!";
-}
-
-
-#--- 1. insert before start ---------------------------------------------------
-
-$toc->setOptions({'insertionPoint' => 'before <h1>'});
- # Generate ToC
-$tocGenerator->generate($toc, "<h1>Header</h1>");
-$tocInsertor->insert($toc, "<h1>Header</h1>", {
- 'output' => \$output,
- 'doGenerateToc' => 0
-});
- # Test ToC
-ok($output, "<ul>\n<li>Header\n</ul><h1>Header</h1>");
-
-
-#--- 2. insert after start ----------------------------------------------------
-
-$toc->setOptions({'insertionPoint' => 'after <h1>'});
- # Generate ToC
-$tocGenerator->generate($toc, "<h1>Header</h1>");
-$tocInsertor->insert($toc, "<h1>Header</h1>", {
- 'output' => \$output,
- 'doGenerateToc' => 0
-});
- # Test ToC
-ok($output, "<h1><ul>\n<li>Header\n</ul>Header</h1>");
-
-
-#--- 3. insert before end -----------------------------------------------------
-
-$toc->setOptions({'insertionPoint' => 'before </h1>'});
- # Generate ToC
-$tocGenerator->generate($toc, "<h1>Header</h1>");
-$tocInsertor->insert($toc, "<h1>Header</h1>", {
- 'output' => \$output,
- 'doGenerateToc' => 0
-});
- # Test ToC
-ok($output, "<h1>Header<ul>\n<li>Header\n</ul></h1>");
-
-
-#--- 4. insert after end ------------------------------------------------------
-
-$toc->setOptions({'insertionPoint' => 'after </h1>'});
- # Generate ToC
-$tocGenerator->generate($toc, "<h1>Header</h1>");
-$tocInsertor->insert($toc, "<h1>Header</h1>", {
- 'output' => \$output,
- 'doGenerateToc' => 0
-});
- # Test ToC
-ok($output, "<h1>Header</h1><ul>\n<li>Header\n</ul>");
-
-
-#--- 5. outputFile ------------------------------------------------------------
-
-$toc->setOptions({'insertionPoint' => 'before <h1>'});
- # Generate ToC
-$tocGenerator->generate($toc, "<h1>Header</h1>");
- # Insert ToC, output to file
-$tocInsertor->insert($toc, "<h1>Header</h1>", {
- 'outputFile' => $filename,
- 'doGenerateToc' => 0
-});
- # Read outputfile
-open(FILE, "<$filename") || die "Can't open $filename: $!";
-$content = join('', <FILE>);
-close(FILE);
- # Test ToC
-ok($output, "<ul>\n<li>Header\n</ul><h1>Header</h1>");
-
-
-#--- 6. empty toc -------------------------------------------------------------
-
-$tocGenerator->generate($toc, "");
-$tocInsertor->insert($toc, "", {
- 'output' => \$output,
- 'doGenerateToc' => 0
-});
-ok($output, "");
-
-
-#--- TestAfterDeclaration() ---------------------------------------------------
-# function: Test putting HTML comment after declaration.
-
-sub TestAfterDeclaration {
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
- my $output;
-
- # Set ToC options
- $toc->setOptions({
- 'insertionPoint' => "after <!ToC>",
- });
- # Generate ToC
- $tocInsertor->insert($toc, <<EOT, {'output' => \$output});
-<!ToC><body>
- <h1>Appendix</h1>
- <h2>Appendix Paragraph</h2>
- <h1>Appendix</h1>
- <h2>Appendix Paragraph</h2>
-</body>
-EOT
- # Test ToC
- ok($output, <<EOT);
-<!ToC>
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1>Appendix</a>
- <ul>
- <li><a href=#h-1.1>Appendix Paragraph</a>
- </ul>
- <li><a href=#h-2>Appendix</a>
- <ul>
- <li><a href=#h-2.1>Appendix Paragraph</a>
- </ul>
-</ul>
-<!-- End of generated Table of Contents -->
-<body>
- <a name=h-1><h1>Appendix</h1></a>
- <a name=h-1.1><h2>Appendix Paragraph</h2></a>
- <a name=h-2><h1>Appendix</h1></a>
- <a name=h-2.1><h2>Appendix Paragraph</h2></a>
-</body>
-EOT
-} # TestAfterDeclaration()
-
-
-#--- TestNumberingStyle() -----------------------------------------------------
-# function: Test numberingstyle.
-
-sub TestNumberingStyle {
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
- my $output;
-
- # Set ToC options
- $toc->setOptions({
- 'numberingStyle' => 'lower-alpha',
- 'doNumberToken' => 1,
- 'tokenToToc' => [{
- 'tokenBegin' => '<h1>',
- }, {
- 'tokenBegin' => '<h2>',
- 'level' => 2,
- 'numberingStyle' => 'upper-alpha'
- }, {
- 'tokenBegin' => '<h3>',
- 'level' => 3,
- 'numberingStyle' => 'decimal'
- }]
- });
- # Generate ToC
- $tocInsertor->insert($toc, <<EOT, {'output' => \$output});
-<body>
- <h1>Chapter</h1>
- <h2>Paragraph</h2>
- <h3>Paragraph</h3>
- <h3>Paragraph</h3>
- <h3>Paragraph</h3>
-</body>
-EOT
- # Test ToC
- ok($output, <<EOT);
-<body>
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-a>Chapter</a>
- <ul>
- <li><a href=#h-a.A>Paragraph</a>
- <ul>
- <li><a href=#h-a.A.1>Paragraph</a>
- <li><a href=#h-a.A.2>Paragraph</a>
- <li><a href=#h-a.A.3>Paragraph</a>
- </ul>
- </ul>
-</ul>
-<!-- End of generated Table of Contents -->
-
- <a name=h-a><h1>a &nbsp;Chapter</h1></a>
- <a name=h-a.A><h2>a.A &nbsp;Paragraph</h2></a>
- <a name=h-a.A.1><h3>a.A.1 &nbsp;Paragraph</h3></a>
- <a name=h-a.A.2><h3>a.A.2 &nbsp;Paragraph</h3></a>
- <a name=h-a.A.3><h3>a.A.3 &nbsp;Paragraph</h3></a>
-</body>
-EOT
-} # TestNumberingStyle()
-
-
-#--- TestReplaceComment() -----------------------------------------------------
-# function: Test replacing HTML comment with ToC.
-
-sub TestReplaceComment {
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
- my $output;
-
- # Set ToC options
- $toc->setOptions({
- 'insertionPoint' => "replace <!-- ToC -->"
- });
- # Generate ToC
- $tocInsertor->insert($toc, <<EOT, {'output' => \$output});
-<!-- ToC -->
-<body>
- <h1>Appendix</h1>
- <h2>Appendix Paragraph</h2>
- <h1>Appendix</h1>
- <h2>Appendix Paragraph</h2>
-</body>
-EOT
- # Test ToC
- ok($output, <<EOT);
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1>Appendix</a>
- <ul>
- <li><a href=#h-1.1>Appendix Paragraph</a>
- </ul>
- <li><a href=#h-2>Appendix</a>
- <ul>
- <li><a href=#h-2.1>Appendix Paragraph</a>
- </ul>
-</ul>
-<!-- End of generated Table of Contents -->
-
-<body>
- <a name=h-1><h1>Appendix</h1></a>
- <a name=h-1.1><h2>Appendix Paragraph</h2></a>
- <a name=h-2><h1>Appendix</h1></a>
- <a name=h-2.1><h2>Appendix Paragraph</h2></a>
-</body>
-EOT
-} # TestReplaceComment()
-
-
-#--- TestReplaceText() -----------------------------------------------------
-# function: Test replacing HTML comment with ToC.
-
-sub TestReplaceText {
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
- my $output;
-
- # Set ToC options
- $toc->setOptions({
- 'insertionPoint' => "replace ToC will be placed here[,]"
- });
- # Generate ToC
- $tocInsertor->insert($toc, <<EOT, {'output' => \$output});
-The ToC will be placed here, overnight.
-<body>
- <h1>Appendix</h1>
- <h2>Appendix Paragraph</h2>
- <h1>Appendix</h1>
- <h2>Appendix Paragraph</h2>
-</body>
-EOT
- # Test ToC
- ok($output, <<EOT);
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1>Appendix</a>
- <ul>
- <li><a href=#h-1.1>Appendix Paragraph</a>
- </ul>
- <li><a href=#h-2>Appendix</a>
- <ul>
- <li><a href=#h-2.1>Appendix Paragraph</a>
- </ul>
-</ul>
-<!-- End of generated Table of Contents -->
-<body>
- <a name=h-1><h1>Appendix</h1></a>
- <a name=h-1.1><h2>Appendix Paragraph</h2></a>
- <a name=h-2><h1>Appendix</h1></a>
- <a name=h-2.1><h2>Appendix Paragraph</h2></a>
-</body>
-EOT
-} # TestReplaceText()
-
-
- # 7. Test 'numberingStyle'
-TestNumberingStyle();
- # 8. Test replace comment
-TestReplaceComment();
- # 9. Test after declaration
-TestAfterDeclaration();
- # 10. Test replace text
-TestReplaceText();
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/manualTest.t b/libvpx/examples/includes/HTML-Toc-0.91/t/manualTest.t
deleted file mode 100644
index cc19fff..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/manualTest.t
+++ /dev/null
@@ -1,768 +0,0 @@
-#--- manual.t -----------------------------------------------------------------
-# function: Test HTML::ToC generating a manual.
-
-use strict;
-use Test;
-
-BEGIN { plan tests => 3; }
-
-use HTML::Toc;
-use HTML::TocGenerator;
-use HTML::TocInsertor;
-use HTML::TocUpdator;
-
-
-#--- AssembleTocLine() --------------------------------------------------------
-# function: Assemble ToC line.
-
-sub AssembleTocLine {
- # Get arguments
- my ($aLevel, $aGroupId, $aNode, $aSequenceNr, $aText) = @_;
- # Local variables
- my ($result);
-
- # Assemble ToC line
- SWITCH: {
- if ($aGroupId eq "prelude") {
- $result = "<li>$aText\n";
- last SWITCH;
- }
- if ($aGroupId eq "part") {
- $result = "<li>Part $aNode &nbsp;$aText\n";
- last SWITCH;
- }
- if ($aGroupId eq "h") {
- $result = "<li>$aSequenceNr. &nbsp;$aText\n";
- last SWITCH;
- }
- else {
- $result = "<li>$aNode &nbsp;$aText\n";
- last SWITCH;
- }
- }
-
- # Return value
- return $result;
-} # AssembleTocLine()
-
-
-#--- AssembleTokenNumber() ----------------------------------------------------
-# function: Assemble token number.
-
-sub AssembleTokenNumber {
- # Get arguments
- my ($aNode, $aGroupId, $aFile, $aGroupLevel, $aLevel, $aToc) = @_;
- # Local variables
- my ($result);
- # Assemble token number
- SWITCH: {
- if ($aGroupId eq "part") {
- $result = "Part $aNode &nbsp;";
- last SWITCH;
- }
- else {
- $result = "$aNode &nbsp;";
- last SWITCH;
- }
- }
- # Return value
- return $result;
-} # AssembleTokenNumber()
-
-
-#--- TestInsertManualToc ------------------------------------------------------
-# function: Test inserting ToC into manual.
-
-sub TestInsertManualToc {
- my $output;
- # Create objects
- my $toc = new HTML::Toc;
- my $tocOfFigures = new HTML::Toc;
- my $tocOfTables = new HTML::Toc;
- my $tocInsertor = new HTML::TocInsertor;
-
- # Set ToC options
- $toc->setOptions({
- 'doNestGroup' => 1,
- 'doNumberToken' => 1,
- 'insertionPoint' => "replace <!-- Table of Contents -->",
- 'templateLevel' => \&AssembleTocLine,
- 'templateLevelBegin' => '"<ul class=toc_$groupId$level>\n"',
- 'templateLevelEnd' => '"</ul>\n"',
- 'templateTokenNumber' => \&AssembleTokenNumber,
- 'tokenToToc' => [{
- 'groupId' => 'part',
- 'doNumberToken' => 1,
- 'level' => 1,
- 'tokenBegin' => '<h1 class=part>',
- }, {
- 'tokenBegin' => '<h1 class=-[appendix|prelude|hidden|part]>'
- }, {
- 'tokenBegin' => '<h2>',
- 'level' => 2
- }, {
- 'tokenBegin' => '<h3>',
- 'level' => 3
- }, {
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h1 class=appendix>',
- 'numberingStyle' => 'upper-alpha',
- }, {
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h2 class=appendix>',
- 'level' => 2
- }, {
- 'groupId' => 'prelude',
- 'tokenBegin' => '<h1 class=prelude>',
- 'level' => 1,
- 'doNumberToken' => 0,
- }],
- });
- $tocOfFigures->setOptions({
- 'doNumberToken' => 1,
- 'insertionPoint' => "replace <!-- Table of Figures -->",
- 'templateLevelBegin' => '"<ol>\n"',
- 'templateLevelEnd' => '"</ol>\n"',
- 'templateTokenNumber' => '"Figure $node: &nbsp;"',
- 'tokenToToc' => [{
- 'groupId' => 'Figure',
- 'tokenBegin' => '<p class=captionFigure>'
- }]
- });
- $tocOfTables->setOptions({
- 'doNumberToken' => 1,
- 'insertionPoint' => "replace <!-- Table of Tables -->",
- 'templateLevelBegin' => '"<ol>\n"',
- 'templateLevelEnd' => '"</ol>\n"',
- 'templateTokenNumber' => '"Table $node: &nbsp;"',
- 'tokenToToc' => [{
- 'groupId' => 'Table',
- 'tokenBegin' => '<p class=captionTable>'
- }]
- });
- # Insert ToC
- $tocInsertor->insertIntoFile(
- [$toc, $tocOfFigures, $tocOfTables],
- 't/ManualTest/manualTest1.htm', {
- 'doUseGroupsGlobal' => 1,
- 'output' => \$output,
- 'outputFile' => 't/ManualTest/manualTest2.htm'
- }
- );
- ok($output, <<EOT);
-<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;
- }
- ul.toc_h1 {
- list-style-type: none;
- margin-left: 1;
- margin-top: 1em;
- margin-bottom: 1em;
- }
- ul.toc_h2 {
- list-style-type: none;
- }
- ul.toc_h3 {
- list-style-type: none;
- }
- ul.toc_part1 {
- list-style-type: none;
- margin-left: 1;
- margin-top: 1em;
- margin-bottom: 1em;
- }
- ul.toc_prelude1 {
- list-style: none;
- }
- p.captionFigure {
- font-style: italic;
- font-weight: bold;
- }
- p.captionTable {
- font-style: italic;
- font-weight: bold;
- }
- </style>
-</head>
-<body>
-
-<a name=prelude-1><h1 class=prelude>Preface</h1></a>
-Better C than never.
-
-<h1 class=hidden>Table of Contents</h1>
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul class=toc_prelude1>
- <li><a href=#prelude-1>Preface</a>
- <li><a href=#prelude-2>Table of Figures</a>
- <li><a href=#prelude-3>Table of Tables</a>
- <li><a href=#prelude-4>Introduction</a>
- <ul class=toc_part1>
- <li>Part 1 &nbsp;<a href=#part-1>Disks</a>
- <ul class=toc_h1>
- <li>1. &nbsp;<a href=#h-1>Compiler Disk v1</a>
- <ul class=toc_h2>
- <li>1. &nbsp;<a href=#h-1.1>System</a>
- <li>2. &nbsp;<a href=#h-1.2>Standard Library</a>
- </ul>
- <li>2. &nbsp;<a href=#h-2>Compiler Disk v2</a>
- <ul class=toc_h2>
- <li>1. &nbsp;<a href=#h-2.1>System</a>
- <ul class=toc_h3>
- <li>1. &nbsp;<a href=#h-2.1.1>parser.com</a>
- <li>2. &nbsp;<a href=#h-2.1.2>compiler.com</a>
- <li>3. &nbsp;<a href=#h-2.1.3>linker.com</a>
- </ul>
- <li>2. &nbsp;<a href=#h-2.2>Standard Library</a>
- </ul>
- <li>3. &nbsp;<a href=#h-3>Library System Disk</a>
- </ul>
- <li>Part 2 &nbsp;<a href=#part-2>Personal</a>
- <ul class=toc_h1>
- <li>4. &nbsp;<a href=#h-4>Tips & Tricks</a>
- </ul>
- <li>Part 3 &nbsp;<a href=#part-3>Appendixes</a>
- <ul class=toc_appendix1>
- <li>A &nbsp;<a href=#appendix-A>Functions Standard Library v1</a>
- <li>B &nbsp;<a href=#appendix-B>Functions Standard Library v2</a>
- <li>C &nbsp;<a href=#appendix-C>Functions Graphic Library</a>
- </ul>
- </ul>
- <li><a href=#prelude-5>Bibliography</a>
-</ul>
-<!-- End of generated Table of Contents -->
-
-
-<a name=prelude-2><h1 class=prelude>Table of Figures</h1></a>
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ol>
- <li><a href=#Figure-1>Contents Compiler Disk v1</a>
- <li><a href=#Figure-2>Contents Compiler Disk v2</a>
-</ol>
-<!-- End of generated Table of Contents -->
-
-
-<a name=prelude-3><h1 class=prelude>Table of Tables</h1></a>
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ol>
- <li><a href=#Table-1>Compile Steps</a>
-</ol>
-<!-- End of generated Table of Contents -->
-
-
-<a name=prelude-4><h1 class=prelude>Introduction</h1></a>
-Thanks to standardisation and the excellent work of the QWERTY corporation it is possible to learn C with almost any C manual.
-<a name=Table-1><p class=captionTable>Table 1: &nbsp;Compile Steps</p></a>
-<ul><pre>
- Parser
- Compiler
- Linker
-</pre></ul>
-
-<a name=part-1><h1 class=part>Part 1 &nbsp;Disks</h1></a>
-<a name=h-1><h1>1 &nbsp;Compiler Disk v1</h1></a>
-<img src=img.gif alt="Contents Compiler Disk v1">
-<a name=Figure-1><p class=captionFigure>Figure 1: &nbsp;Contents Compiler Disk v1</p></a>
-
-<a name=h-1.1><h2>1.1 &nbsp;System</h2></a>
-<a name=h-1.2><h2>1.2 &nbsp;Standard Library</h2></a>
-
-<a name=h-2><h1>2 &nbsp;Compiler Disk v2</h1></a>
-<img src=img.gif alt="Contents Compiler Disk v2">
-<a name=Figure-2><p class=captionFigure>Figure 2: &nbsp;Contents Compiler Disk v2</p></a>
-
-<a name=h-2.1><h2>2.1 &nbsp;System</h2></a>
-<a name=h-2.1.1><h3>2.1.1 &nbsp;parser.com</h3></a>
-<a name=h-2.1.2><h3>2.1.2 &nbsp;compiler.com</h3></a>
-<a name=h-2.1.3><h3>2.1.3 &nbsp;linker.com</h3></a>
-<a name=h-2.2><h2>2.2 &nbsp;Standard Library</h2></a>
-
-<a name=h-3><h1>3 &nbsp;Library System Disk</h1></a>
-<a name=part-2><h1 class=part>Part 2 &nbsp;Personal</h1></a>
-<a name=h-4><h1>4 &nbsp;Tips & Tricks</h1></a>
-<a name=part-3><h1 class=part>Part 3 &nbsp;Appendixes</h1></a>
-<a name=appendix-A><h1 class=appendix>A &nbsp;Functions Standard Library v1</h1></a>
-<a name=appendix-B><h1 class=appendix>B &nbsp;Functions Standard Library v2</h1></a>
-<a name=appendix-C><h1 class=appendix>C &nbsp;Functions Graphic Library</h1></a>
-<a name=prelude-5><h1 class=prelude>Bibliography</h1></a>
-</body>
-</html>
-EOT
-} # TestInsertManualToc()
-
-
-#--- TestInsertManualForUpdating() --------------------------------------------
-# function: Test inserting ToC into manual.
-
-sub TestInsertManualForUpdating {
- my $output;
- # Create objects
- my $toc = new HTML::Toc;
- my $tocOfFigures = new HTML::Toc;
- my $tocOfTables = new HTML::Toc;
- my $tocUpdator = new HTML::TocUpdator;
-
- # Set ToC options
- $toc->setOptions({
- 'doNestGroup' => 1,
- 'doNumberToken' => 1,
- 'insertionPoint' => "after <!-- Table of Contents -->",
- 'templateLevel' => \&AssembleTocLine,
- 'templateLevelBegin' => '"<ul class=toc_$groupId$level>\n"',
- 'templateLevelEnd' => '"</ul>\n"',
- 'templateTokenNumber' => \&AssembleTokenNumber,
- 'tokenToToc' => [{
- 'groupId' => 'part',
- 'doNumberToken' => 1,
- 'level' => 1,
- 'tokenBegin' => '<h1 class=part>',
- }, {
- 'tokenBegin' => '<h1 class=-[appendix|prelude|hidden|part]>'
- }, {
- 'tokenBegin' => '<h2>',
- 'level' => 2
- }, {
- 'tokenBegin' => '<h3>',
- 'level' => 3
- }, {
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h1 class=appendix>',
- 'numberingStyle' => 'upper-alpha',
- }, {
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h2 class=appendix>',
- 'level' => 2
- }, {
- 'groupId' => 'prelude',
- 'tokenBegin' => '<h1 class=prelude>',
- 'level' => 1,
- 'doNumberToken' => 0,
- }],
- });
- $tocOfFigures->setOptions({
- 'doNumberToken' => 1,
- 'insertionPoint' => "after <!-- Table of Figures -->",
- 'templateLevelBegin' => '"<ol>\n"',
- 'templateLevelEnd' => '"</ol>\n"',
- 'templateTokenNumber' => '"Figure $node: &nbsp;"',
- 'tokenToToc' => [{
- 'groupId' => 'Figure',
- 'tokenBegin' => '<p class=captionFigure>'
- }]
- });
- $tocOfTables->setOptions({
- 'doNumberToken' => 1,
- 'insertionPoint' => "after <!-- Table of Tables -->",
- 'templateLevelBegin' => '"<ol>\n"',
- 'templateLevelEnd' => '"</ol>\n"',
- 'templateTokenNumber' => '"Table $node: &nbsp;"',
- 'tokenToToc' => [{
- 'groupId' => 'Table',
- 'tokenBegin' => '<p class=captionTable>'
- }]
- });
- # Insert ToC
- $tocUpdator->updateFile(
- [$toc, $tocOfFigures, $tocOfTables],
- 't/ManualTest/manualTest1.htm', {
- 'doUseGroupsGlobal' => 1,
- 'output' => \$output,
- 'outputFile' => 't/ManualTest/manualTest3.htm'
- }
- );
- ok($output, <<EOT);
-<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;
- }
- ul.toc_h1 {
- list-style-type: none;
- margin-left: 1;
- margin-top: 1em;
- margin-bottom: 1em;
- }
- ul.toc_h2 {
- list-style-type: none;
- }
- ul.toc_h3 {
- list-style-type: none;
- }
- ul.toc_part1 {
- list-style-type: none;
- margin-left: 1;
- margin-top: 1em;
- margin-bottom: 1em;
- }
- ul.toc_prelude1 {
- list-style: none;
- }
- p.captionFigure {
- font-style: italic;
- font-weight: bold;
- }
- p.captionTable {
- font-style: italic;
- font-weight: bold;
- }
- </style>
-</head>
-<body>
-
-<!-- #BeginTocAnchorNameBegin --><a name=prelude-1><!-- #EndTocAnchorNameBegin --><h1 class=prelude>Preface</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-Better C than never.
-
-<h1 class=hidden>Table of Contents</h1>
-<!-- Table of Contents --><!-- #BeginToc -->
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul class=toc_prelude1>
- <li><a href=#prelude-1>Preface</a>
- <li><a href=#prelude-2>Table of Figures</a>
- <li><a href=#prelude-3>Table of Tables</a>
- <li><a href=#prelude-4>Introduction</a>
- <ul class=toc_part1>
- <li>Part 1 &nbsp;<a href=#part-1>Disks</a>
- <ul class=toc_h1>
- <li>1. &nbsp;<a href=#h-1>Compiler Disk v1</a>
- <ul class=toc_h2>
- <li>1. &nbsp;<a href=#h-1.1>System</a>
- <li>2. &nbsp;<a href=#h-1.2>Standard Library</a>
- </ul>
- <li>2. &nbsp;<a href=#h-2>Compiler Disk v2</a>
- <ul class=toc_h2>
- <li>1. &nbsp;<a href=#h-2.1>System</a>
- <ul class=toc_h3>
- <li>1. &nbsp;<a href=#h-2.1.1>parser.com</a>
- <li>2. &nbsp;<a href=#h-2.1.2>compiler.com</a>
- <li>3. &nbsp;<a href=#h-2.1.3>linker.com</a>
- </ul>
- <li>2. &nbsp;<a href=#h-2.2>Standard Library</a>
- </ul>
- <li>3. &nbsp;<a href=#h-3>Library System Disk</a>
- </ul>
- <li>Part 2 &nbsp;<a href=#part-2>Personal</a>
- <ul class=toc_h1>
- <li>4. &nbsp;<a href=#h-4>Tips & Tricks</a>
- </ul>
- <li>Part 3 &nbsp;<a href=#part-3>Appendixes</a>
- <ul class=toc_appendix1>
- <li>A &nbsp;<a href=#appendix-A>Functions Standard Library v1</a>
- <li>B &nbsp;<a href=#appendix-B>Functions Standard Library v2</a>
- <li>C &nbsp;<a href=#appendix-C>Functions Graphic Library</a>
- </ul>
- </ul>
- <li><a href=#prelude-5>Bibliography</a>
-</ul>
-<!-- End of generated Table of Contents -->
-<!-- #EndToc -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=prelude-2><!-- #EndTocAnchorNameBegin --><h1 class=prelude>Table of Figures</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- Table of Figures --><!-- #BeginToc -->
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ol>
- <li><a href=#Figure-1>Contents Compiler Disk v1</a>
- <li><a href=#Figure-2>Contents Compiler Disk v2</a>
-</ol>
-<!-- End of generated Table of Contents -->
-<!-- #EndToc -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=prelude-3><!-- #EndTocAnchorNameBegin --><h1 class=prelude>Table of Tables</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- Table of Tables --><!-- #BeginToc -->
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ol>
- <li><a href=#Table-1>Compile Steps</a>
-</ol>
-<!-- End of generated Table of Contents -->
-<!-- #EndToc -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=prelude-4><!-- #EndTocAnchorNameBegin --><h1 class=prelude>Introduction</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-Thanks to standardisation and the excellent work of the QWERTY corporation it is possible to learn C with almost any C manual.
-<!-- #BeginTocAnchorNameBegin --><a name=Table-1><!-- #EndTocAnchorNameBegin --><p class=captionTable><!-- #BeginTocNumber -->Table 1: &nbsp;<!-- #EndTocNumber -->Compile Steps</p><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<ul><pre>
- Parser
- Compiler
- Linker
-</pre></ul>
-
-<!-- #BeginTocAnchorNameBegin --><a name=part-1><!-- #EndTocAnchorNameBegin --><h1 class=part><!-- #BeginTocNumber -->Part 1 &nbsp;<!-- #EndTocNumber -->Disks</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-1><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->1 &nbsp;<!-- #EndTocNumber -->Compiler Disk v1</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<img src=img.gif alt="Contents Compiler Disk v1">
-<!-- #BeginTocAnchorNameBegin --><a name=Figure-1><!-- #EndTocAnchorNameBegin --><p class=captionFigure><!-- #BeginTocNumber -->Figure 1: &nbsp;<!-- #EndTocNumber -->Contents Compiler Disk v1</p><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=h-1.1><!-- #EndTocAnchorNameBegin --><h2><!-- #BeginTocNumber -->1.1 &nbsp;<!-- #EndTocNumber -->System</h2><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-1.2><!-- #EndTocAnchorNameBegin --><h2><!-- #BeginTocNumber -->1.2 &nbsp;<!-- #EndTocNumber -->Standard Library</h2><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=h-2><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->2 &nbsp;<!-- #EndTocNumber -->Compiler Disk v2</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<img src=img.gif alt="Contents Compiler Disk v2">
-<!-- #BeginTocAnchorNameBegin --><a name=Figure-2><!-- #EndTocAnchorNameBegin --><p class=captionFigure><!-- #BeginTocNumber -->Figure 2: &nbsp;<!-- #EndTocNumber -->Contents Compiler Disk v2</p><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=h-2.1><!-- #EndTocAnchorNameBegin --><h2><!-- #BeginTocNumber -->2.1 &nbsp;<!-- #EndTocNumber -->System</h2><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-2.1.1><!-- #EndTocAnchorNameBegin --><h3><!-- #BeginTocNumber -->2.1.1 &nbsp;<!-- #EndTocNumber -->parser.com</h3><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-2.1.2><!-- #EndTocAnchorNameBegin --><h3><!-- #BeginTocNumber -->2.1.2 &nbsp;<!-- #EndTocNumber -->compiler.com</h3><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-2.1.3><!-- #EndTocAnchorNameBegin --><h3><!-- #BeginTocNumber -->2.1.3 &nbsp;<!-- #EndTocNumber -->linker.com</h3><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-2.2><!-- #EndTocAnchorNameBegin --><h2><!-- #BeginTocNumber -->2.2 &nbsp;<!-- #EndTocNumber -->Standard Library</h2><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=h-3><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->3 &nbsp;<!-- #EndTocNumber -->Library System Disk</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=part-2><!-- #EndTocAnchorNameBegin --><h1 class=part><!-- #BeginTocNumber -->Part 2 &nbsp;<!-- #EndTocNumber -->Personal</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-4><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->4 &nbsp;<!-- #EndTocNumber -->Tips & Tricks</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=part-3><!-- #EndTocAnchorNameBegin --><h1 class=part><!-- #BeginTocNumber -->Part 3 &nbsp;<!-- #EndTocNumber -->Appendixes</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=appendix-A><!-- #EndTocAnchorNameBegin --><h1 class=appendix><!-- #BeginTocNumber -->A &nbsp;<!-- #EndTocNumber -->Functions Standard Library v1</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=appendix-B><!-- #EndTocAnchorNameBegin --><h1 class=appendix><!-- #BeginTocNumber -->B &nbsp;<!-- #EndTocNumber -->Functions Standard Library v2</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=appendix-C><!-- #EndTocAnchorNameBegin --><h1 class=appendix><!-- #BeginTocNumber -->C &nbsp;<!-- #EndTocNumber -->Functions Graphic Library</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=prelude-5><!-- #EndTocAnchorNameBegin --><h1 class=prelude>Bibliography</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-</body>
-</html>
-EOT
-} # TestInsertManualForUpdating()
-
-
-#--- TestUpdateManual() -------------------------------------------------------
-# function: Test inserting ToC into manual.
-
-sub TestUpdateManual {
- my $output;
- # Create objects
- my $toc = new HTML::Toc;
- my $tocOfFigures = new HTML::Toc;
- my $tocOfTables = new HTML::Toc;
- my $tocUpdator = new HTML::TocUpdator;
-
- # Set ToC options
- $toc->setOptions({
- 'doNestGroup' => 1,
- 'doNumberToken' => 1,
- 'insertionPoint' => "after <!-- Table of Contents -->",
- 'templateLevel' => \&AssembleTocLine,
- 'templateLevelBegin' => '"<ul class=toc_$groupId$level>\n"',
- 'templateLevelEnd' => '"</ul>\n"',
- 'templateTokenNumber' => \&AssembleTokenNumber,
- 'tokenToToc' => [{
- 'groupId' => 'part',
- 'doNumberToken' => 1,
- 'level' => 1,
- 'tokenBegin' => '<h1 class=part>',
- }, {
- 'tokenBegin' => '<h1 class=-[appendix|prelude|hidden|part]>'
- }, {
- 'tokenBegin' => '<h2>',
- 'level' => 2
- }, {
- 'tokenBegin' => '<h3>',
- 'level' => 3
- }, {
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h1 class=appendix>',
- 'numberingStyle' => 'upper-alpha',
- }, {
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h2 class=appendix>',
- 'level' => 2
- }, {
- 'groupId' => 'prelude',
- 'tokenBegin' => '<h1 class=prelude>',
- 'level' => 1,
- 'doNumberToken' => 0,
- }],
- });
- $tocOfFigures->setOptions({
- 'doNumberToken' => 1,
- 'insertionPoint' => "after <!-- Table of Figures -->",
- 'templateLevelBegin' => '"<ol>\n"',
- 'templateLevelEnd' => '"</ol>\n"',
- 'templateTokenNumber' => '"Figure $node: &nbsp;"',
- 'tokenToToc' => [{
- 'groupId' => 'Figure',
- 'tokenBegin' => '<p class=captionFigure>'
- }]
- });
- $tocOfTables->setOptions({
- 'doNumberToken' => 1,
- 'insertionPoint' => "after <!-- Table of Tables -->",
- 'templateLevelBegin' => '"<ol>\n"',
- 'templateLevelEnd' => '"</ol>\n"',
- 'templateTokenNumber' => '"Table $node: &nbsp;"',
- 'tokenToToc' => [{
- 'groupId' => 'Table',
- 'tokenBegin' => '<p class=captionTable>'
- }]
- });
- # Insert ToC
- $tocUpdator->updateFile(
- [$toc, $tocOfFigures, $tocOfTables],
- 't/ManualTest/manualTest3.htm', {
- 'doUseGroupsGlobal' => 1,
- 'output' => \$output,
- 'outputFile' => 't/ManualTest/manualTest4.htm'
- }
- );
- ok($output, <<EOT);
-<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;
- }
- ul.toc_h1 {
- list-style-type: none;
- margin-left: 1;
- margin-top: 1em;
- margin-bottom: 1em;
- }
- ul.toc_h2 {
- list-style-type: none;
- }
- ul.toc_h3 {
- list-style-type: none;
- }
- ul.toc_part1 {
- list-style-type: none;
- margin-left: 1;
- margin-top: 1em;
- margin-bottom: 1em;
- }
- ul.toc_prelude1 {
- list-style: none;
- }
- p.captionFigure {
- font-style: italic;
- font-weight: bold;
- }
- p.captionTable {
- font-style: italic;
- font-weight: bold;
- }
- </style>
-</head>
-<body>
-
-<!-- #BeginTocAnchorNameBegin --><a name=prelude-1><!-- #EndTocAnchorNameBegin --><h1 class=prelude>Preface</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-Better C than never.
-
-<h1 class=hidden>Table of Contents</h1>
-<!-- Table of Contents --><!-- #BeginToc -->
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul class=toc_prelude1>
- <li><a href=#prelude-1>Preface</a>
- <li><a href=#prelude-2>Table of Figures</a>
- <li><a href=#prelude-3>Table of Tables</a>
- <li><a href=#prelude-4>Introduction</a>
- <ul class=toc_part1>
- <li>Part 1 &nbsp;<a href=#part-1>Disks</a>
- <ul class=toc_h1>
- <li>1. &nbsp;<a href=#h-1>Compiler Disk v1</a>
- <ul class=toc_h2>
- <li>1. &nbsp;<a href=#h-1.1>System</a>
- <li>2. &nbsp;<a href=#h-1.2>Standard Library</a>
- </ul>
- <li>2. &nbsp;<a href=#h-2>Compiler Disk v2</a>
- <ul class=toc_h2>
- <li>1. &nbsp;<a href=#h-2.1>System</a>
- <ul class=toc_h3>
- <li>1. &nbsp;<a href=#h-2.1.1>parser.com</a>
- <li>2. &nbsp;<a href=#h-2.1.2>compiler.com</a>
- <li>3. &nbsp;<a href=#h-2.1.3>linker.com</a>
- </ul>
- <li>2. &nbsp;<a href=#h-2.2>Standard Library</a>
- </ul>
- <li>3. &nbsp;<a href=#h-3>Library System Disk</a>
- </ul>
- <li>Part 2 &nbsp;<a href=#part-2>Personal</a>
- <ul class=toc_h1>
- <li>4. &nbsp;<a href=#h-4>Tips & Tricks</a>
- </ul>
- <li>Part 3 &nbsp;<a href=#part-3>Appendixes</a>
- <ul class=toc_appendix1>
- <li>A &nbsp;<a href=#appendix-A>Functions Standard Library v1</a>
- <li>B &nbsp;<a href=#appendix-B>Functions Standard Library v2</a>
- <li>C &nbsp;<a href=#appendix-C>Functions Graphic Library</a>
- </ul>
- </ul>
- <li><a href=#prelude-5>Bibliography</a>
-</ul>
-<!-- End of generated Table of Contents -->
-<!-- #EndToc -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=prelude-2><!-- #EndTocAnchorNameBegin --><h1 class=prelude>Table of Figures</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- Table of Figures --><!-- #BeginToc -->
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ol>
- <li><a href=#Figure-1>Contents Compiler Disk v1</a>
- <li><a href=#Figure-2>Contents Compiler Disk v2</a>
-</ol>
-<!-- End of generated Table of Contents -->
-<!-- #EndToc -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=prelude-3><!-- #EndTocAnchorNameBegin --><h1 class=prelude>Table of Tables</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- Table of Tables --><!-- #BeginToc -->
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ol>
- <li><a href=#Table-1>Compile Steps</a>
-</ol>
-<!-- End of generated Table of Contents -->
-<!-- #EndToc -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=prelude-4><!-- #EndTocAnchorNameBegin --><h1 class=prelude>Introduction</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-Thanks to standardisation and the excellent work of the QWERTY corporation it is possible to learn C with almost any C manual.
-<!-- #BeginTocAnchorNameBegin --><a name=Table-1><!-- #EndTocAnchorNameBegin --><p class=captionTable><!-- #BeginTocNumber -->Table 1: &nbsp;<!-- #EndTocNumber -->Compile Steps</p><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<ul><pre>
- Parser
- Compiler
- Linker
-</pre></ul>
-
-<!-- #BeginTocAnchorNameBegin --><a name=part-1><!-- #EndTocAnchorNameBegin --><h1 class=part><!-- #BeginTocNumber -->Part 1 &nbsp;<!-- #EndTocNumber -->Disks</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-1><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->1 &nbsp;<!-- #EndTocNumber -->Compiler Disk v1</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<img src=img.gif alt="Contents Compiler Disk v1">
-<!-- #BeginTocAnchorNameBegin --><a name=Figure-1><!-- #EndTocAnchorNameBegin --><p class=captionFigure><!-- #BeginTocNumber -->Figure 1: &nbsp;<!-- #EndTocNumber -->Contents Compiler Disk v1</p><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=h-1.1><!-- #EndTocAnchorNameBegin --><h2><!-- #BeginTocNumber -->1.1 &nbsp;<!-- #EndTocNumber -->System</h2><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-1.2><!-- #EndTocAnchorNameBegin --><h2><!-- #BeginTocNumber -->1.2 &nbsp;<!-- #EndTocNumber -->Standard Library</h2><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=h-2><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->2 &nbsp;<!-- #EndTocNumber -->Compiler Disk v2</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<img src=img.gif alt="Contents Compiler Disk v2">
-<!-- #BeginTocAnchorNameBegin --><a name=Figure-2><!-- #EndTocAnchorNameBegin --><p class=captionFigure><!-- #BeginTocNumber -->Figure 2: &nbsp;<!-- #EndTocNumber -->Contents Compiler Disk v2</p><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=h-2.1><!-- #EndTocAnchorNameBegin --><h2><!-- #BeginTocNumber -->2.1 &nbsp;<!-- #EndTocNumber -->System</h2><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-2.1.1><!-- #EndTocAnchorNameBegin --><h3><!-- #BeginTocNumber -->2.1.1 &nbsp;<!-- #EndTocNumber -->parser.com</h3><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-2.1.2><!-- #EndTocAnchorNameBegin --><h3><!-- #BeginTocNumber -->2.1.2 &nbsp;<!-- #EndTocNumber -->compiler.com</h3><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-2.1.3><!-- #EndTocAnchorNameBegin --><h3><!-- #BeginTocNumber -->2.1.3 &nbsp;<!-- #EndTocNumber -->linker.com</h3><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-2.2><!-- #EndTocAnchorNameBegin --><h2><!-- #BeginTocNumber -->2.2 &nbsp;<!-- #EndTocNumber -->Standard Library</h2><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=h-3><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->3 &nbsp;<!-- #EndTocNumber -->Library System Disk</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=part-2><!-- #EndTocAnchorNameBegin --><h1 class=part><!-- #BeginTocNumber -->Part 2 &nbsp;<!-- #EndTocNumber -->Personal</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-4><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->4 &nbsp;<!-- #EndTocNumber -->Tips & Tricks</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=part-3><!-- #EndTocAnchorNameBegin --><h1 class=part><!-- #BeginTocNumber -->Part 3 &nbsp;<!-- #EndTocNumber -->Appendixes</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=appendix-A><!-- #EndTocAnchorNameBegin --><h1 class=appendix><!-- #BeginTocNumber -->A &nbsp;<!-- #EndTocNumber -->Functions Standard Library v1</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=appendix-B><!-- #EndTocAnchorNameBegin --><h1 class=appendix><!-- #BeginTocNumber -->B &nbsp;<!-- #EndTocNumber -->Functions Standard Library v2</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=appendix-C><!-- #EndTocAnchorNameBegin --><h1 class=appendix><!-- #BeginTocNumber -->C &nbsp;<!-- #EndTocNumber -->Functions Graphic Library</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=prelude-5><!-- #EndTocAnchorNameBegin --><h1 class=prelude>Bibliography</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-</body>
-</html>
-EOT
-} # TestUpdateManual()
-
-
- # Test inserting ToC into manual
-TestInsertManualToc();
- # Test inserting ToC with update tokens into manual
-TestInsertManualForUpdating();
- # Test updating ToC
-TestUpdateManual();
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/options.t b/libvpx/examples/includes/HTML-Toc-0.91/t/options.t
deleted file mode 100644
index 04bedac..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/options.t
+++ /dev/null
@@ -1,194 +0,0 @@
-#--- options.t ----------------------------------------------------------------
-# function: Test HTML::ToC. In particular test the available options.
-
-use strict;
-use Test;
-
-BEGIN { plan tests => 5; }
-
-use HTML::Toc;
-use HTML::TocGenerator;
-use HTML::TocInsertor;
-use HTML::TocUpdator;
-
-my ($filename);
-
-BEGIN {
- # Create test file
- $filename = "file$$.htm";
- die "$filename is already there" if -e $filename;
-}
-
-
-END {
- # Remove test file
- unlink($filename) or warn "Can't unlink $filename: $!";
-}
-
-
-#--- TestAttributeToExcludeToken() --------------------------------------------
-# function: Test 'HTML::Toc' option 'attributeToExcludeToken'
-
-sub TestAttributeToExcludeToken {
- # Assemble test file
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<body>
- <h1>Chapter 1</h1>
- <h1 class=appendix>Appendix</h1>
-</body>
-EOT
-
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocGenerator = HTML::TocGenerator->new();
-
- $toc->setOptions({
- 'attributeToExcludeToken' => 'foo',
- 'tokenToToc' => [{
- 'tokenBegin' => '<h1 class=foodix>'
- }]
- });
- # Generate ToC
- $tocGenerator->generateFromFile($toc, $filename);
- # Test ToC
- ok($toc->format(), <<EOT);
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1>Chapter 1</a>
-</ul>
-<!-- End of generated Table of Contents -->
-EOT
-} # TestAttributeToExcludeToken()
-
-
-#--- TestAttributeToTocToken() ------------------------------------------------
-# function: Test 'HTML::Toc' option 'attributeToTocToken'
-
-sub TestAttributeToTocToken {
- # Assemble test file
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<body>
- <img src=test.gif alt=Picture>
-</body>
-</html>
-EOT
-
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocGenerator = HTML::TocGenerator->new();
-
- $toc->setOptions({
- 'attributeToTocToken' => 'foo',
- 'tokenToToc' => [{
- 'groupId' => 'image',
- 'tokenBegin' => '<img alt=foo>'
- }],
- });
- # Generate ToC
- $tocGenerator->generateFromFile($toc, $filename);
- # Test ToC
- ok($toc->format(), <<EOT);
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#image-1>Picture</a>
-</ul>
-<!-- End of generated Table of Contents -->
-EOT
-} # TestAttributeToTocToken()
-
-
-#--- TestNumberingStyleDecimal ------------------------------------------------
-# function: Test 'decimal' numbering style.
-
-sub TestNumberingStyleDecimal {
- # Local variables
- my $output;
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
-
- $toc->setOptions({
- 'doNumberToken' => 1,
- 'tokenToToc' => [{
- 'level' => 1,
- 'tokenBegin' => '<h1>',
- 'numberingStyle' => 'decimal'
- }],
- });
- # Generate ToC
- $tocInsertor->insert($toc, "<h1>Header</h1>", {'output' => \$output});
- # Test ToC
- ok("$output\n", <<EOT);
-<a name=h-1><h1>1 &nbsp;Header</h1></a>
-EOT
-} # TestNumberingStyleDecimal()
-
-
-#--- TestNumberingStyleLowerAlpha ---------------------------------------------
-# function: Test 'lower-alpha' numbering style.
-
-sub TestNumberingStyleLowerAlpha {
- # Local variables
- my $output;
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
-
- $toc->setOptions({
- 'doNumberToken' => 1,
- 'tokenToToc' => [{
- 'level' => 1,
- 'tokenBegin' => '<h1>',
- 'numberingStyle' => 'lower-alpha'
- }],
- });
- # Generate ToC
- $tocInsertor->insert($toc, "<h1>Header</h1>", {'output' => \$output});
- # Test ToC
- ok("$output\n", <<EOT);
-<a name=h-a><h1>a &nbsp;Header</h1></a>
-EOT
-} # TestNumberingStyleLowerAlpha()
-
-
-#--- TestNumberingStyleUpperAlpha ---------------------------------------------
-# function: Test 'upper-alpha' numbering style.
-
-sub TestNumberingStyleUpperAlpha {
- # Local variables
- my $output;
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
-
- $toc->setOptions({
- 'doNumberToken' => 1,
- 'tokenToToc' => [{
- 'level' => 1,
- 'tokenBegin' => '<h1>',
- 'numberingStyle' => 'upper-alpha'
- }],
- });
- # Generate ToC
- $tocInsertor->insert($toc, "<h1>Header</h1>", {'output' => \$output});
- # Test ToC
- ok("$output\n", <<EOT);
-<a name=h-A><h1>A &nbsp;Header</h1></a>
-EOT
-} # TestNumberingStyleUpperAlpha()
-
-
- # Test 'attributeToTocToken'
-TestAttributeToTocToken();
- # Test 'attributeToExcludeToken'
-TestAttributeToExcludeToken();
- # Test 'numberingStyleDecimal'
-TestNumberingStyleDecimal();
- # Test 'numberingStyleLowerAlpha'
-TestNumberingStyleLowerAlpha();
- # Test 'numberingStyleUpperAlpha'
-TestNumberingStyleUpperAlpha();
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/podExamples.t b/libvpx/examples/includes/HTML-Toc-0.91/t/podExamples.t
deleted file mode 100644
index 6a546e6..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/podExamples.t
+++ /dev/null
@@ -1,709 +0,0 @@
-#--- podExamples.t ------------------------------------------------------------
-# function: Test HTML::ToC. In particular test the examples as described in
-# the POD documentation.
-
-use strict;
-use Test;
-
-BEGIN { plan tests => 13; }
-
-use HTML::Toc;
-use HTML::TocGenerator;
-use HTML::TocInsertor;
-use HTML::TocUpdator;
-
-my ($filename, $filename2);
-
-
-BEGIN {
- # Create test file
- $filename = "tmp.htm";
- die "$filename is already there" if -e $filename;
- # Create test file 2
- $filename2 = "tmp2.htm";
- die "$filename2 is already there" if -e $filename2;
-}
-
-
-END {
- # Remove test file
- unlink($filename) or warn "Can't unlink $filename: $!";
- # Remove test file 2
- unlink($filename2) or warn "Can't unlink $filename2: $!";
-}
-
-
-#--- TestExtendFromFile() --------------------------------------------------
-# function: Test 'HTML::TocGenerator->extendFromFile()
-
-sub TestExtendFromFile {
- # Assemble test file
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<body>
- <h1>Chapter of document 1</h1>
-</body>
-EOT
-
- # Assemble test file 2
- open(FILE, ">$filename2") || die "Can't create $filename2: $!";
- print FILE <<'EOT'; close(FILE);
-<html>
-<body>
- <h1>Chapter of document 2</h1>
-</body>
-</html>
-EOT
-
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocGenerator = HTML::TocGenerator->new();
-
- # Set ToC options
- $toc->setOptions({'doLinkToFile' => 1});
- # Generate ToC
- $tocGenerator->generateFromFile($toc, $filename);
- $tocGenerator->extendFromFile($toc, $filename2);
- # Test ToC
- ok($toc->format(), <<EOT);
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=tmp.htm#h-1>Chapter of document 1</a>
- <li><a href=tmp2.htm#h-2>Chapter of document 2</a>
-</ul>
-<!-- End of generated Table of Contents -->
-EOT
-} # TestExtendFromFile()
-
-
-#--- TestGenerateFromFiles() --------------------------------------------------
-# function: Test 'HTML::TocGenerator->generateFromFile()
-
-sub TestGenerateFromFiles {
- # Assemble test file
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<body>
- <h1>Chapter of document 1</h1>
-</body>
-EOT
-
- # Assemble test file 2
- open(FILE, ">$filename2") || die "Can't create $filename2: $!";
- print FILE <<'EOT'; close(FILE);
-<html>
-<body>
- <h1>Chapter of document 2</h1>
-</body>
-</html>
-EOT
-
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocGenerator = HTML::TocGenerator->new();
-
- # Set ToC options
- $toc->setOptions({'doLinkToFile' => 1});
- # Generate ToC
- $tocGenerator->generateFromFile($toc, [$filename, $filename2]);
- # Test ToC
- ok($toc->format(), <<EOT);
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=tmp.htm#h-1>Chapter of document 1</a>
- <li><a href=tmp2.htm#h-2>Chapter of document 2</a>
-</ul>
-<!-- End of generated Table of Contents -->
-EOT
-} # TestGenerateFromFiles()
-
-
-#--- TestGenerateFromFiles() --------------------------------------------------
-# function: Test 'HTML::TocGenerator->generateFromFile() using multiple files.
-
-sub TestGenerateFromFile {
- # Assemble test file 1
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<html>
-<body>
- <h1>Chapter</h1>
-</body>
-</html>
-EOT
-
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocGenerator = HTML::TocGenerator->new();
-
- # Generate ToC
- $tocGenerator->generateFromFile($toc, $filename);
- # Test ToC
- ok($toc->format(), <<EOT);
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1>Chapter</a>
-</ul>
-<!-- End of generated Table of Contents -->
-EOT
-} # TestGenerateFromFile()
-
-
-#--- TestInsertIntoFile() -----------------------------------------------------
-# function: Test 'HTML::TocInsertor->insertIntoFile()
-
-sub TestInsertIntoFile {
- # Assemble test file
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<html>
-<body>
- <h1>Chapter</h1>
-</body>
-</html>
-EOT
-
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
- my $output;
-
- # Generate ToC
- $tocInsertor->insertIntoFile($toc, $filename, {'output' => \$output});
- # Test ToC
- ok($output, <<EOT);
-<html>
-<body>
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1>Chapter</a>
-</ul>
-<!-- End of generated Table of Contents -->
-
- <a name=h-1><h1>Chapter</h1></a>
-</body>
-</html>
-EOT
-} # TestInsertIntoFile()
-
-
-#--- TestInsertIntoFileUsingTocUpdator() --------------------------------------
-# function: Test 'HTML::TocUpdator->insertIntoFile()
-
-sub TestInsertIntoFileUsingTocUpdator {
- # Assemble test file
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<html>
-<body>
- <h1>
- Chapter
- </h1>
-</body>
-</html>
-EOT
-
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocUpdator = HTML::TocUpdator->new();
- my $output;
-
- # Generate ToC
- $tocUpdator->insertIntoFile($toc, $filename, {'output' => \$output});
- # Test ToC
- ok($output, <<EOT);
-<html>
-<body><!-- #BeginToc -->
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1> Chapter </a>
-</ul>
-<!-- End of generated Table of Contents -->
-<!-- #EndToc -->
- <!-- #BeginTocAnchorNameBegin --><a name=h-1><!-- #EndTocAnchorNameBegin --><h1>
- Chapter
- </h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-</body>
-</html>
-EOT
-} # TestInsertIntoFileUsingTocUpdator()
-
-
-#--- TestGlobalGroups0() ------------------------------------------------------
-# function: Test 'HTML::TocGenerator' option 'doUseGroupsGlobal = 0'.
-
-sub TestGlobalGroups0 {
- # Assemble test file
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<h1>Chapter</h1>
-<h2>Paragraph</h2>
-EOT
-
- # Create objects
- my $toc1 = HTML::Toc->new();
- my $toc2 = HTML::Toc->new();
- my $tocGenerator = HTML::TocGenerator->new();
-
- # Set options
- $toc1->setOptions({
- 'header' => '',
- 'footer' => '',
- 'tokenToToc' => [{'tokenBegin' => '<h1>'}]
- });
- $toc2->setOptions({
- 'header' => '',
- 'footer' => '',
- 'tokenToToc' => [{'tokenBegin' => '<h2>'}]
- });
- # Generate ToC
- $tocGenerator->generateFromFile([$toc1, $toc2], $filename);
- # Test ToC
- ok($toc1->format() . $toc2->format() . "\n", <<'EOT');
-<ul>
- <li><a href=#h-1>Chapter</a>
-</ul><ul>
- <li><a href=#h-1>Paragraph</a>
-</ul>
-EOT
-} # TestGlobalGroups0()
-
-
-#--- TestGlobalGroups1() ------------------------------------------------------
-# function: Test 'HTML::TocGenerator' option 'doUseGroupsGlobal = 0'.
-
-sub TestGlobalGroups1 {
- # Assemble test file
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT';
-<h1>Chapter</h1>
-<h2>Paragraph</h2>
-EOT
- close(FILE);
-
- # Create objects
- my $toc1 = HTML::Toc->new();
- my $toc2 = HTML::Toc->new();
- my $tocGenerator = HTML::TocGenerator->new();
-
- # Set options
- $toc1->setOptions({
- 'header' => '',
- 'footer' => '',
- 'tokenToToc' => [{'tokenBegin' => '<h1>'}]
- });
- $toc2->setOptions({
- 'header' => '',
- 'footer' => '',
- 'tokenToToc' => [{'tokenBegin' => '<h2>'}]
- });
- # Generate ToC
- $tocGenerator->generateFromFile(
- [$toc1, $toc2], $filename, {'doUseGroupsGlobal' => 1}
- );
- # Test ToC
- ok($toc1->format() . $toc2->format() . "\n", <<'EOT');
-<ul>
- <li><a href=#h-1>Chapter</a>
-</ul><ul>
- <li><a href=#h-2>Paragraph</a>
-</ul>
-EOT
-} # TestGlobalGroups1()
-
-
-#--- TestMultipleGroupsAppendix() ---------------------------------------------
-# function: Test multiple ToCs
-
-sub TestMultipleGroupsAppendix() {
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
- my $output;
-
- # Set ToC options
- $toc->setOptions({
- 'tokenToToc' => [{
- 'tokenBegin' => '<h1 class=-appendix>'
- }, {
- 'tokenBegin' => '<h2 class=-appendix>',
- 'level' => 2
- }, {
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h1 class=appendix>',
- }, {
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h2 class=appendix>',
- 'level' => 2
- }],
- });
- # Generate ToC
- $tocInsertor->insert($toc, <<EOT, {'output' => \$output});
-<body>
- <h1>Chapter</h1>
- <h2>Paragraph</h2>
- <h3>Subparagraph</h3>
- <h1>Chapter</h1>
- <h1 class=appendix>Appendix Chapter</h1>
- <h2 class=appendix>Appendix Paragraph</h2>
-</body>
-EOT
- # Test ToC
- ok($output, <<EOT);
-<body>
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1>Chapter</a>
- <ul>
- <li><a href=#h-1.1>Paragraph</a>
- </ul>
- <li><a href=#h-2>Chapter</a>
-</ul>
-<ul>
- <li><a href=#appendix-1>Appendix Chapter</a>
- <ul>
- <li><a href=#appendix-1.1>Appendix Paragraph</a>
- </ul>
-</ul>
-<!-- End of generated Table of Contents -->
-
- <a name=h-1><h1>Chapter</h1></a>
- <a name=h-1.1><h2>Paragraph</h2></a>
- <h3>Subparagraph</h3>
- <a name=h-2><h1>Chapter</h1></a>
- <a name=appendix-1><h1 class=appendix>Appendix Chapter</h1></a>
- <a name=appendix-1.1><h2 class=appendix>Appendix Paragraph</h2></a>
-</body>
-EOT
-} # TestMultipleGroupsAppendix()
-
-
-#--- TestMultipleGroupsPart() -------------------------------------------------
-# function: Test multiple ToCs
-
-sub TestMultipleGroupsPart() {
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
- my $output;
-
- # Set ToC options
- $toc->setOptions({
- 'tokenToToc' => [{
- 'tokenBegin' => '<h1 class=-part>'
- }, {
- 'tokenBegin' => '<h2 class=-part>',
- 'level' => 2,
- }, {
- 'groupId' => 'part',
- 'tokenBegin' => '<h1 class=part>',
- 'level' => 1,
- 'doNumberToken' => 1,
- 'numberingStyle' => 'upper-alpha'
- }]
- });
- # Generate ToC
- $tocInsertor->insert($toc, <<EOT, {'output' => \$output});
-<body>
- <h1 class=part>First Part</h1>
- <h1>Chapter</h1>
- <h2>Paragraph</h2>
- <h1 class=part>Second Part</h1>
- <h1>Chapter</h1>
- <h2>Paragraph</h2>
-</body>
-EOT
- # Test ToC
- ok($output, <<EOT);
-<body>
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#part-A>First Part</a>
-</ul>
-<ul>
- <li><a href=#h-1>Chapter</a>
- <ul>
- <li><a href=#h-1.1>Paragraph</a>
- </ul>
-</ul>
-<ul>
- <li><a href=#part-B>Second Part</a>
-</ul>
-<ul>
- <li><a href=#h-2>Chapter</a>
- <ul>
- <li><a href=#h-2.1>Paragraph</a>
- </ul>
-</ul>
-<!-- End of generated Table of Contents -->
-
- <a name=part-A><h1 class=part>A &nbsp;First Part</h1></a>
- <a name=h-1><h1>Chapter</h1></a>
- <a name=h-1.1><h2>Paragraph</h2></a>
- <a name=part-B><h1 class=part>B &nbsp;Second Part</h1></a>
- <a name=h-2><h1>Chapter</h1></a>
- <a name=h-2.1><h2>Paragraph</h2></a>
-</body>
-EOT
-} # TestMultipleGroupsPart()
-
-
-#--- TestMultipleTocs() -------------------------------------------------------
-# function: Test multiple ToCs
-
-sub TestMultipleTocs() {
- # Assemble test file
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<body>
- <h1>Header One</h1>
- <img src=test1.gif alt="First picture">
- <h2>Paragraph One</h2>
- <img src=test2.gif alt="Second picture">
-</body>
-EOT
-
- # Create objects
- my $toc1 = HTML::Toc->new();
- my $toc2 = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
- my $output;
-
- # Set ToC options
- $toc2->setOptions({
- 'tokenToToc' => [{
- 'groupId' => 'image',
- 'tokenBegin' => '<img alt=@>'
- }],
- });
- # Generate ToC
- $tocInsertor->insertIntoFile(
- [$toc1, $toc2], $filename, {'output' => \$output}
- );
- # Test ToC
- ok($output, <<EOT);
-<body>
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1>Header One</a>
- <ul>
- <li><a href=#h-1.1>Paragraph One</a>
- </ul>
-</ul>
-<!-- End of generated Table of Contents -->
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#image-1>First picture</a>
- <li><a href=#image-2>Second picture</a>
-</ul>
-<!-- End of generated Table of Contents -->
-
- <a name=h-1><h1>Header One</h1></a>
- <a name=image-1><img src=test1.gif alt="First picture"></a>
- <a name=h-1.1><h2>Paragraph One</h2></a>
- <a name=image-2><img src=test2.gif alt="Second picture"></a>
-</body>
-EOT
-} # TestMultipleTocs()
-
-
-#--- TestSpecifyNumberedList() ------------------------------------------------
-# function: Test specifying numbered list.
-
-sub TestSpecifyNumberedList {
- # Assemble test file
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<body>
- <h1>Chapter</h1>
- <h2>Paragraph</h2>
-</body>
-EOT
-
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocGenerator = HTML::TocGenerator->new();
-
- # Set ToC options
- $toc->setOptions({
- 'templateLevelBegin' => '"<ol>\n"',
- 'templateLevelEnd' => '"</ol>\n"',
- });
- # Generate ToC
- $tocGenerator->generateFromFile($toc, $filename);
- # Test ToC
- ok($toc->format(), <<EOT);
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ol>
- <li><a href=#h-1>Chapter</a>
- <ol>
- <li><a href=#h-1.1>Paragraph</a>
- </ol>
-</ol>
-<!-- End of generated Table of Contents -->
-EOT
-} # TestSpecifyNumberedList()
-
-
-#--- TestUpdateFile() ---------------------------------------------------------
-# function: Test 'HTML::TocUpdator->updateFile()'
-
-sub TestUpdateFile {
- # Assemble test file
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<html>
-<body><!-- #BeginToc -->
-foo
-<!-- #EndToc -->
- <!-- #BeginTocAnchorNameBegin -->bar<!-- #EndTocAnchorNameBegin --><h1>
- Chapter
- </h1><!-- #BeginTocAnchorNameEnd -->foo<!-- #EndTocAnchorNameEnd -->
-</body>
-</html>
-EOT
-
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocUpdator = HTML::TocUpdator->new();
- my $output;
-
- # Generate ToC
- $tocUpdator->updateFile($toc, $filename, {'output' => \$output});
- # Test ToC
- ok($output, <<EOT);
-<html>
-<body><!-- #BeginToc -->
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1> Chapter </a>
-</ul>
-<!-- End of generated Table of Contents -->
-<!-- #EndToc -->
- <!-- #BeginTocAnchorNameBegin --><a name=h-1><!-- #EndTocAnchorNameBegin --><h1>
- Chapter
- </h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-</body>
-</html>
-EOT
-} # TestUpdateFile()
-
-
-#--- TestUsingCSS() -----------------------------------------------------------
-# function: Test multiple ToCs
-
-sub TestUsingCSS() {
-
- # Create objects
- my $toc = new HTML::Toc;
- my $tocInsertor = new HTML::TocInsertor;
- my $output;
-
- $toc->setOptions({
- 'templateLevelBegin' => '"<ol class=toc_$groupId$level>\n"',
- 'templateLevelEnd' => '"</ol>\n"',
- 'doNumberToken' => 1,
- 'tokenToToc' => [{
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h1>',
- 'numberingStyle' => 'upper-alpha'
- }, {
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h2>',
- 'level' => 2,
- }]
- });
- $tocInsertor->insert($toc, <<EOT);
-<html>
-<head>
- <style type="text/css">
- ol.toc_appendix1 { list-style-type: upper-alpha }
- </style>
-</head>
-<body>
- <h1>Appendix</h1>
- <h2>Appendix Paragraph</h2>
- <h1>Appendix</h1>
- <h2>Appendix Paragraph</h2>
-</body>
-</html>
-EOT
- # Insert ToC
- $tocInsertor->insert($toc, <<EOT, {'output' => \$output});
-<html>
-<head>
- <style type="text/css">
- ol.toc_appendix1 { list-style-type: upper-alpha }
- </style>
-</head>
-<body>
- <h1>Appendix</h1>
- <h2>Appendix Paragraph</h2>
- <h1>Appendix</h1>
- <h2>Appendix Paragraph</h2>
-</body>
-</html>
-EOT
- # Test ToC
- ok($output, <<EOT);
-<html>
-<head>
- <style type="text/css">
- ol.toc_appendix1 { list-style-type: upper-alpha }
- </style>
-</head>
-<body>
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ol class=toc_appendix1>
- <li><a href=#appendix-A>Appendix</a>
- <ol class=toc_appendix2>
- <li><a href=#appendix-A.1>Appendix Paragraph</a>
- </ol>
- <li><a href=#appendix-B>Appendix</a>
- <ol class=toc_appendix2>
- <li><a href=#appendix-B.1>Appendix Paragraph</a>
- </ol>
-</ol>
-<!-- End of generated Table of Contents -->
-
- <a name=appendix-A><h1>A &nbsp;Appendix</h1></a>
- <a name=appendix-A.1><h2>A.1 &nbsp;Appendix Paragraph</h2></a>
- <a name=appendix-B><h1>B &nbsp;Appendix</h1></a>
- <a name=appendix-B.1><h2>B.1 &nbsp;Appendix Paragraph</h2></a>
-</body>
-</html>
-EOT
-} # TestUsingCSS()
-
-
- # Test 'extendFromFile()'
-TestExtendFromFile();
- # Test 'generateFromFile()'
-TestGenerateFromFile();
- # Test 'generateFromFiles()'
-TestGenerateFromFiles();
- # Test 'doUseGroupsGlobal = 0'
-TestGlobalGroups0();
- # Test 'doUseGroupsGlobal = 1'
-TestGlobalGroups1();
- # Test 'tocInsertor->insertIntoFile'
-TestInsertIntoFile();
- # Test 'tocUpdator->insertIntoFile'
-TestInsertIntoFileUsingTocUpdator();
- # Test additional 'appendix' group
-TestMultipleGroupsAppendix();
- # Test additional 'part' group
-TestMultipleGroupsPart();
- # Test multiple ToCs
-TestMultipleTocs();
- # Test specifying numbered list
-TestSpecifyNumberedList();
- # Test 'updateFile()'
-TestUpdateFile();
- # Test using CSS
-TestUsingCSS();
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/propagate.t b/libvpx/examples/includes/HTML-Toc-0.91/t/propagate.t
deleted file mode 100644
index 63de18d..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/propagate.t
+++ /dev/null
@@ -1,176 +0,0 @@
-#--- propagate.t --------------------------------------------------------------
-# function: Test ToC propagation.
-
-use strict;
-use Test;
-
-BEGIN { plan tests => 10; }
-
-use HTML::Toc;
-use HTML::TocGenerator;
-use HTML::TocInsertor;
-
-my ($output, $content, $filename);
-my $toc = HTML::Toc->new;
-my $tocGenerator = HTML::TocGenerator->new;
-my $tocInsertor = HTML::TocInsertor->new;
-
-$toc->setOptions({
- 'doLinkToToken' => 0,
- 'levelIndent' => 0,
- 'insertionPoint' => 'before <h1>',
- 'header' => '',
- 'footer' => '',
-});
-
-
-BEGIN {
- # Create test file
- $filename = "file$$.htm";
- die "$filename is already there" if -e $filename;
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<h1>Header</h1>
-EOT
-}
-
-
-END {
- # Remove test file
- unlink($filename) or warn "Can't unlink $filename: $!";
-}
-
-
-#--- 1. propagate -------------------------------------------------------------
-
-$tocInsertor->insert($toc, "<h1>Header</h1>", {'output' => \$output});
-ok($output, "<ul>\n<li>Header\n</ul><h1>Header</h1>");
-
-
-#--- 2. propagateFile ---------------------------------------------------------
-
-$tocInsertor->insertIntoFile($toc, $filename, {'output' => \$output});
-ok($output, "<ul>\n<li>Header\n</ul><h1>Header</h1>\n");
-
-
-#--- 3. doLinkToToken -----------------------------------------------------
-
-$toc->setOptions({'doLinkToToken' => 1});
-$tocInsertor->insert($toc, "<h1>Header</h1>", {'output' => \$output});
-ok("$output\n", <<'EOT');
-<ul>
-<li><a href=#h-1>Header</a>
-</ul><a name=h-1><h1>Header</h1></a>
-EOT
-
-
-#--- 4. templateAnchorHrefBegin -----------------------------------------------
-
-$toc->setOptions(
- {'templateAnchorHrefBegin' => '"<$node${file}test${groupId}>"'}
-);
-$tocInsertor->insertIntoFile($toc, $filename, {'output' => \$output});
-ok($output, "<ul>\n<li><1${filename}testh>Header</a>\n</ul><a name=h-1><h1>Header</h1></a>\n");
-$toc->setOptions({'templateAnchorHrefBegin' => undef});
-
-
-#--- 5. templateAnchorNameBegin -----------------------------------------------
-
-$toc->setOptions({
- 'templateAnchorName' => '"$node$groupId"',
- 'templateAnchorNameBegin' => '"<$anchorName>"'
-});
-$tocInsertor->insert($toc, "<h1>Header</h1>", {'output' => \$output});
-ok($output, "<ul>\n<li><a href=#1h>Header</a>\n</ul><1h><h1>Header</h1></a>");
-$toc->setOptions({'templateAnchorName' => undef});
-
-
-#--- 6. templateAnchorName function -------------------------------------------
-
-sub AssembleAnchorName {
- # Get arguments
- my ($aFile, $aGroupId, $aLevel, $aNode) = @_;
- # Return value
- return $aFile . $aGroupId . $aLevel . $aNode;
-} # AssembleAnchorName()
-
- # Set options
-$toc->setOptions({'templateAnchorNameBegin' => \&AssembleAnchorName});
- # Propagate ToC
-$tocInsertor->insert($toc, "<h1>Header</h1>", {'output' => \$output});
- # Test ToC
-ok($output, "<ul>\n<li><a href=#h-1>Header</a>\n</ul>h11<h1>Header</h1></a>");
- # Restore options
-$toc->setOptions({'templateAnchorNameBegin' => undef});
-
-
-#--- 7. doNumberToken --------------------------------------------------------
-
- # Set options
-$toc->setOptions({'doNumberToken' => 1});
-$tocInsertor->insert($toc, "<h1>Header</h1>", {'output' => \$output});
-ok("$output\n", <<'EOT');
-<ul>
-<li><a href=#h-1>Header</a>
-</ul><a name=h-1><h1>1 &nbsp;Header</h1></a>
-EOT
- # Reset options
-$toc->setOptions({
- 'templateTokenNumber' => undef,
- 'doNumberToken' => 0
-});
-
-
-#--- 8. templateTokenNumber ---------------------------------------------------
-
- # Set options
-$toc->setOptions({
- 'templateTokenNumber' => '"-$node-"',
- 'doNumberToken' => 1
-});
- # Propagate ToC
-$tocInsertor->insert($toc, "<h1>Header</h1>", {'output' => \$output});
- # Test ToC
-ok("$output\n", <<'EOT');
-<ul>
-<li><a href=#h-1>Header</a>
-</ul><a name=h-1><h1>-1-Header</h1></a>
-EOT
- # Reset options
-$toc->setOptions({
- 'doNumberToken' => 0,
- 'templateTokenNumber' => undef
-});
-
-
-#--- 9. numberingStyle --------------------------------------------------------
-
- # Set options
-$toc->setOptions({
- 'doNumberToken' => 1,
- 'tokenToToc' => [{
- 'level' => 1,
- 'tokenBegin' => '<h1>',
- 'numberingStyle' => 'lower-alpha'
- }]
-});
- # Propagate ToC
-$tocInsertor->insert($toc, "<h1>Header</h1>", {'output' => \$output});
- # Test ToC
-ok("$output\n", <<'EOT');
-<ul>
-<li><a href=#h-a>Header</a>
-</ul><a name=h-a><h1>a &nbsp;Header</h1></a>
-EOT
- # Reset options
-$toc->setOptions({
- 'doNumberToken' => 0,
- 'tokenToToc' => undef,
-});
-
-
-#--- 10. declaration pass through ---------------------------------------------
-
-$tocInsertor->insert($toc, '<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><h1>Header</h1>', {'output' => \$output});
- # Test ToC
-ok($output, '<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><h1>Header</h1>');
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/siteMap.t b/libvpx/examples/includes/HTML-Toc-0.91/t/siteMap.t
deleted file mode 100644
index 074f0bd..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/siteMap.t
+++ /dev/null
@@ -1,97 +0,0 @@
-#--- manual.t -----------------------------------------------------------------
-# function: Test HTML::ToC generating a manual.
-
-use strict;
-use Test;
-
-BEGIN { plan tests => 1; }
-
-use Data::Dumper;
-use File::Find;
-use HTML::Toc;
-use HTML::TocGenerator;
-use HTML::TocInsertor;
-use HTML::TocUpdator;
-
-
- # Create objects
-my $toc = HTML::Toc->new();
-my $tocGenerator = HTML::TocGenerator->new();
-my @fileList;
-
-
-#--- TestSiteMap() ------------------------------------------------------------
-# function: Test specifying numbered list.
-
-sub TestSiteMap {
- # Set ToC options
- $toc->setOptions({
- 'doLinkToFile' => 1,
- 'templateAnchorName' => '""',
- 'templateAnchorHref' => '"<a href=$file"."#".$groupId.$level.">"',
- 'doLinkTocToToken' => 1,
- 'tokenToToc' => [{
- 'groupId' => 'dir',
- 'level' => 1,
- 'tokenBegin' => '<title>',
- 'tokenEnd' => '</title>',
- 'fileSpec' => '\./[^/]+$'
- }, {
- 'groupId' => 'dir',
- 'level' => 2,
- 'tokenBegin' => '<title>',
- 'tokenEnd' => '</title>',
- 'fileSpec' => '\./[^/]+?/[^/]+$'
- }, {
- 'groupId' => 'dir',
- 'level' => 3,
- 'tokenBegin' => '<title>',
- 'tokenEnd' => '</title>',
- 'fileSpec' => '\./[^/]+?/[^/]+?/[^/]+$'
- }]
- });
- # Change current directory
- chdir("t/SiteMap");
- # Find files, filling 'fileList'
- find({wanted => \&WantedSiteMap, no_chdir => 1}, '.');
- # Generate ToC of case-insensitively sorted file list
- $tocGenerator->extendFromFile(
- $toc, [sort {uc($a) cmp uc($b)} @fileList]
- );
- # Restore current directory
- chdir("../..");
- # Test ToC
- ok($toc->format(), <<EOT);
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=./index.htm#>Main</a>
- <ul>
- <li><a href=./SubDir1/index.htm#>Sub1</a>
- <ul>
- <li><a href=./SubDir1/SubSubDir1/index.htm#>SubSub1</a>
- </ul>
- <li><a href=./SubDir2/index.htm#>Sub2</a>
- <ul>
- <li><a href=./SubDir2/SubSubDir1/index.htm#>SubSub1</a>
- <li><a href=./SubDir2/SubSubDir2/index.htm#>SubSub2</a>
- </ul>
- <li><a href=./SubDir3/index.htm#>Sub3</a>
- </ul>
-</ul>
-<!-- End of generated Table of Contents -->
-EOT
-} # TestSiteMap()
-
-
-#--- WantedSiteMap() ----------------------------------------------------------
-# function: 'Wanted' function, used by File::Find of 'TestSiteMap()'.
-
-sub WantedSiteMap {
- # Add file to 'fileList' if extension matches '.htm'
- push (@fileList, $File::Find::name) if (m/\.htm$/);
-} # WantedSiteMap()
-
-
- # Test site map
-TestSiteMap();
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/update.t b/libvpx/examples/includes/HTML-Toc-0.91/t/update.t
deleted file mode 100644
index e4777b6..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/update.t
+++ /dev/null
@@ -1,114 +0,0 @@
-#--- update.t -----------------------------------------------------------------
-# function: Test ToC updating.
-
-use strict;
-use Test;
-
-BEGIN { plan tests => 6; }
-
-use HTML::Toc;
-use HTML::TocUpdator;
-
-my ($output, $output2, $content, $filename);
-my $toc = HTML::Toc->new;
-my $tocUpdator = HTML::TocUpdator->new;
-
-$toc->setOptions({
- 'doLinkToToken' => 1,
- 'doNumberToken' => 1,
- 'levelIndent' => 0,
- 'insertionPoint' => 'before <h1>',
- 'header' => '',
- 'footer' => '',
-});
-
-
-BEGIN {
- # Create test file
- $filename = "file$$.htm";
- die "$filename is already there" if -e $filename;
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<h1>Header</h1>
-EOT
-}
-
-
-END {
- # Remove test file
- unlink($filename) or warn "Can't unlink $filename: $!";
-}
-
-
-#--- 1. update ----------------------------------------------------------------
-
-$tocUpdator->update($toc, "<h1>Header</h1>", {'output' => \$output});
-ok("$output\n", <<'EOT');
-<!-- #BeginToc --><ul>
-<li><a href=#h-1>Header</a>
-</ul><!-- #EndToc --><!-- #BeginTocAnchorNameBegin --><a name=h-1><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->1 &nbsp;<!-- #EndTocNumber -->Header</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-EOT
-
-#--- 2. updateFile ------------------------------------------------------------
-
-$tocUpdator->updateFile($toc, $filename, {'output' => \$output});
- open(FILE, ">a.out1") || die "Can't create a.out1: $!";
- print FILE $output; close(FILE);
-$output2 = <<'EOT';
-<!-- #BeginToc --><ul>
-<li><a href=#h-1>Header</a>
-</ul><!-- #EndToc --><!-- #BeginTocAnchorNameBegin --><a name=h-1><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->1 &nbsp;<!-- #EndTocNumber -->Header</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-EOT
- open(FILE, ">a.out2") || die "Can't create a.out2: $!";
- print FILE $output2; close(FILE);
-ok($output, $output2);
-
-
-#--- 3. insert ----------------------------------------------------------------
-
-$tocUpdator->insert($toc, "<h1>Header</h1>", {'output' => \$output});
-ok("$output\n", <<'EOT');
-<!-- #BeginToc --><ul>
-<li><a href=#h-1>Header</a>
-</ul><!-- #EndToc --><!-- #BeginTocAnchorNameBegin --><a name=h-1><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->1 &nbsp;<!-- #EndTocNumber -->Header</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-EOT
-
-#--- 4. insertIntoFile --------------------------------------------------------
-
-$tocUpdator->insertIntoFile($toc, $filename, {'output' => \$output});
-ok($output, <<'EOT');
-<!-- #BeginToc --><ul>
-<li><a href=#h-1>Header</a>
-</ul><!-- #EndToc --><!-- #BeginTocAnchorNameBegin --><a name=h-1><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->1 &nbsp;<!-- #EndTocNumber -->Header</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-EOT
-
-
-#--- 5. update twice ----------------------------------------------------------
-
-$tocUpdator->update($toc, "<h1>Header</h1>", {'output' => \$output});
-$tocUpdator->update($toc, $output, {'output' => \$output2});
-ok("$output\n", <<'EOT');
-<!-- #BeginToc --><ul>
-<li><a href=#h-1>Header</a>
-</ul><!-- #EndToc --><!-- #BeginTocAnchorNameBegin --><a name=h-1><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->1 &nbsp;<!-- #EndTocNumber -->Header</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-EOT
-
-
-#--- 6. tokens update begin & end ---------------------------------------------
-
-$toc->setOptions({
- 'tokenUpdateBeginOfAnchorNameBegin' => '<tocAnchorNameBegin>',
- 'tokenUpdateEndOfAnchorNameBegin' => '</tocAnchorNameBegin>',
- 'tokenUpdateBeginOfAnchorNameEnd' => '<tocAnchorNameEnd>',
- 'tokenUpdateEndOfAnchorNameEnd' => '</tocAnchorNameEnd>',
- 'tokenUpdateBeginNumber' => '<tocNumber>',
- 'tokenUpdateEndNumber' => '</tocNumber>',
- 'tokenUpdateBeginToc' => '<toc>',
- 'tokenUpdateEndToc', => '</toc>'
-});
-$tocUpdator->update($toc, "<h1>Header</h1>", {'output' => \$output});
-ok("$output\n", <<'EOT');
-<toc><ul>
-<li><a href=#h-1>Header</a>
-</ul></toc><tocAnchorNameBegin><a name=h-1></tocAnchorNameBegin><h1><tocNumber>1 &nbsp;</tocNumber>Header</h1><tocAnchorNameEnd></a></tocAnchorNameEnd>
-EOT