Last change
on this file since 454 was
44,
checked in by fielding@…, 15 years ago
|
set executable
|
-
Property svn:eol-style set to
native
-
Property svn:executable set to
*
|
File size:
654 bytes
|
Rev | Line | |
---|
[28] | 1 | #!/usr/bin/perl |
---|
| 2 | # |
---|
| 3 | # read each line from each HTML file on command-line |
---|
| 4 | # looking for table of contents. print only the ToC |
---|
| 5 | # with substitutions for an external outline jump table. |
---|
| 6 | |
---|
| 7 | $intoc = 0; |
---|
| 8 | $title = ""; |
---|
| 9 | |
---|
| 10 | while (<>) { |
---|
| 11 | if ($intoc) { |
---|
| 12 | s/<a href="\#/<a href="$ARGV\#/g; |
---|
| 13 | print; |
---|
| 14 | if (m:^ </ul>:o) { |
---|
| 15 | $intoc = 0; |
---|
| 16 | } |
---|
| 17 | } |
---|
| 18 | else { |
---|
| 19 | if (/^ <p class="title">([^<]*)</o) { |
---|
| 20 | $title = $1; |
---|
| 21 | } |
---|
| 22 | elsif (/<a href="#rfc\.toc">Table of Contents/o) { |
---|
| 23 | print "\n<h2><a href=\"$ARGV\">$title</a></h2>\n"; |
---|
| 24 | $intoc = 1; |
---|
| 25 | $title = ""; |
---|
| 26 | } |
---|
| 27 | } |
---|
| 28 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.