Skip to content

Commit ade3303

Browse files
committed
start to munge URLs
1 parent 7f0c910 commit ade3303

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

htmlify.pl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
# this script isn't in bin/ because it's not meant
77
# to be installed.
88

9+
sub url-munge($_) {
10+
return $_ if m{^ <[a..z]>+ '::/'};
11+
return "/type/$_" if m/^<[A..Z]>/;
12+
return "/routine/$_" if m/^<[a..z]>/;
13+
return $_;
14+
}
15+
916
my $*DEBUG = False;
1017

1118
my %names;
@@ -181,7 +188,7 @@ ($out_dir = 'html', Bool :$debug)
181188
}),
182189
);
183190
my $file = open :w, "$out_dir/index.html";
184-
$file.print: pod2html($pod);
191+
$file.print: pod2html($pod, :url(&url-munge));
185192
$file.close;
186193
}
187194

@@ -197,6 +204,6 @@ ($out_dir = 'html', Bool :$debug)
197204
})
198205
);
199206
my $file = open :w, "$out_dir/routine/$name.html";
200-
$file.print: pod2html($pod);
207+
$file.print: pod2html($pod, :url(&url-munge));
201208
$file.close;
202209
}

0 commit comments

Comments
 (0)