Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
This change completely solves the problem of dead links in a 'From ' …
…field on generated routine/ pages.

It takes real a link kind from the actual pod and it works for a sub/method/term/routine/*fix link types.
  • Loading branch information
Altai-man committed Aug 5, 2016
1 parent aacd49d commit 5c1a6f0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion htmlify.p6
Expand Up @@ -914,7 +914,15 @@ sub write-kind($kind) {
pod-block("From ",
pod-link(.origin.name,
.origin.url ~ '#' ~ (.subkinds~'_' if .subkinds ~~ /fix/) ~
($subkind eq 'sub' ?? 'routine_' !! 'method_') ~ .name),
(
if .subkinds ~~ /fix/ { '' }
# It looks really weird, but in reality, it checks pod content,
# then extracts a link(e.g. 'routine abs'), then this string
# splits by space characted and we take a correct category name.
# It works with sub/method/term/routine/*fix types, so all our links
# here are correct.
else { .pod[0].contents[0].contents.Str.split(' ')[0] ~ '_'; }
) ~ .name.subst(' ', '_')),
),
.pod.list,
})
Expand Down

0 comments on commit 5c1a6f0

Please sign in to comment.