Fix a bunch of broken internal links in the docs. Add a hokey link checker.
This commit is contained in:
parent
6d4884d983
commit
874390831a
2 changed files with 81 additions and 58 deletions
26
src/etc/check-links.pl
Executable file
26
src/etc/check-links.pl
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/perl -w
|
||||
|
||||
my $file = $ARGV[0];
|
||||
|
||||
my @lines = <>;
|
||||
|
||||
my $anchors = {};
|
||||
|
||||
my $i = 0;
|
||||
foreach $line (@lines) {
|
||||
$i++;
|
||||
if ($line =~ m/id="([^"]+)"/) {
|
||||
$anchors->{$1} = $i;
|
||||
}
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
foreach $line (@lines) {
|
||||
$i++;
|
||||
while ($line =~ m/href="#([^"]+)"/g) {
|
||||
if (! exists($anchors->{$1})) {
|
||||
print "$file:$i: $1 referenced\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue