File: make-toc.pl

package info (click to toggle)
vile 9.7ze-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 8,372 kB
  • ctags: 9,314
  • sloc: ansic: 95,840; lex: 11,395; sh: 3,416; perl: 3,200; cpp: 3,180; makefile: 982; awk: 271; sed: 14
file content (48 lines) | stat: -rw-r--r-- 931 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/perl -w
# $Id: make-toc.pl,v 1.5 2009/12/28 16:16:13 tom Exp $

use strict;

use HTML::Toc;
use HTML::TocGenerator;

use POSIX qw(strftime);
our $now_string = strftime "%a %b %e %H:%M:%S %Y %Z", localtime;

print <<EOF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--
  \$Id\$

  inputs: @ARGV
  update: $now_string
-->
EOF
;
print <<EOF
<HTML>
<HEAD>
<TITLE>
VI Like Emacs &mdash; Table of Contents
</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rev="made" href="mailto:dickey\@invisible-island.net">
<link rel="SHORTCUT ICON" href="/img/icons/vile.ico" type="image/x-icon">
</HEAD>
<BODY>
EOF
;

my $toc          = HTML::Toc->new();
my $tocGenerator = HTML::TocGenerator->new();

$toc->setOptions({'doLinkToFile' => 1});
$toc->setOptions({'doLinkToId' => 1});
$tocGenerator->generateFromFile($toc, \@ARGV);
print $toc->format();

print <<EOF

</body>
EOF
;