Skip to content

Commit

Permalink
Allow links to /routine pages
Browse files Browse the repository at this point in the history
cfa++
  • Loading branch information
coke committed Mar 16, 2023
1 parent e52b6c8 commit 6ac220d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions xt/rakudoc-types.rakutest
Expand Up @@ -10,7 +10,10 @@ Any other formatting code that refers to a type will fail the test; any C<>
that isn't inside of an L<> will fail, and any L<> that doesn't have a C<>
will fail. Links may end with an optional #id.
One exception: Referring to a type on its own page should only use C<>.
Eexceptions:
=item Referring to a type on its own page should only use C<>.
=item It's Ok to refer to a routine page with the same name instead.
=end overview

Expand Down Expand Up @@ -108,8 +111,14 @@ sub is-valid-type($node, $parent, $file) {
# \o/
pass "L<{render-node($node)}|$meta>";
} else {
# Wrapped in an L<> with wrong URL
flunk "L<{render-node($node)}|$meta> should be L<C<$type>|/type/$type-colon> - bad link";
if $meta.starts-with('/routine/') {
# Is this pointing to an routine page? /routine is generated, so we cannot verify
# the existence of an actual file; trust if present.
pass "L<{render-node($node)}|$meta> - routine";
} else {
# Wrapped in an L<> with wrong URL
flunk "L<{render-node($node)}|$meta> should be L<C<$type>|/type/$type-colon> - bad link";
}
}
}

Expand Down

0 comments on commit 6ac220d

Please sign in to comment.