repo.or.cz
/
sunny256-utils.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
mktar: Use `wc` instead of `du` in summary message
[sunny256-utils.git]
/
outl
blob
c322b897c83a935fb1a296e41d2fed1a459f1260
1
#!/usr/bin/env perl
2
3
# outl
4
# File ID: e9ab7e9e-5d41-11df-92c4-90e6ba3022ac
5
# Lager en outline over HTML-dokumenter.
6
7
use
strict
;
8
use
warnings
;
9
10
while
(<>) {
11
if
(
/<h([1-6]).*?>(.*)<\/
h
[
1
-
6
]>/
i
) {
12
my
(
$Cnt
,
$Txt
) = (
$1
,
$2
);
13
while
(
$Cnt
--) {
14
print
(
"
\t
"
);
15
}
16
$Txt
=~
s/<a name=.+?>//g
;
17
$Txt
=~
s/<\/a>/
/
g
;
18
$Txt
=~
s/^\s+//
;
19
$Txt
=~
s/\s+$//
;
20
print
"
$Txt
\n
"
;
21
}
22
}