diff --git a/htmlify.p6 b/htmlify.p6 index 805923c5b..3fe9d6883 100755 --- a/htmlify.p6 +++ b/htmlify.p6 @@ -207,15 +207,9 @@ sub process-pod-dir($dir, :&sorted-by = &[cmp]) { my $total = +@pod-sources; my $kind = $dir.lc; for @pod-sources.kv -> $num, (:key($filename), :value($file)) { - try { - printf "% 4d/%d: % -40s => %s\n", $num+1, $total, $file.path, "$kind/$filename"; - my $pod = extract-pod($file.path); - process-pod-source :$kind, :$pod, :$filename, :pod-is-complete; - CATCH { - note "Error Processing: $filename"; - .resume; - } - } + printf "% 4d/%d: % -40s => %s\n", $num+1, $total, $file.path, "$kind/$filename"; + my $pod = extract-pod($file.path); + process-pod-source :$kind, :$pod, :$filename, :pod-is-complete; } } @@ -565,7 +559,7 @@ sub find-definitions(:$pod, :$origin, :$min-level = -1, :$url) { my $new-head = Pod::Heading.new( :level(@pod-section[$i].level), - :contents[pod-link "($origin.name()) $subkinds $name", + :contents[pod-link "($origin.name()) $subkinds {$name.gist}", $created.url ~ "#$origin.human-kind() $origin.name()".subst(:g, /\s+/, '_') ] ); @@ -674,7 +668,7 @@ sub write-search-file() { $s.trans([] => [<\\/ \\\\ \\">]); } my @items = $*DR.get-kinds.map(-> $kind { - $*DR.lookup($kind, :by).categorize({escape .name})\ + $*DR.lookup($kind, :by).categorize({escape .name.gist})\ .pairs.sort({.key}).map: -> (:key($name), :value(@docs)) { qq[[\{ category: "{ ( @docs > 1 ?? $kind !! @docs.[0].subkinds[0] ).wordcase @@ -868,7 +862,7 @@ sub write-kind($kind) { } .pod[0].contents[0].contents.Str.split(' ')[1] ~ '_'; } - ) ~ .name.subst(' ', '_')), + ) ~ .name.gist.subst(' ', '_')), ), .pod.list, }) diff --git a/lib/Perl6/Documentable.pm6 b/lib/Perl6/Documentable.pm6 index 58a990c2c..bf7934605 100644 --- a/lib/Perl6/Documentable.pm6 +++ b/lib/Perl6/Documentable.pm6 @@ -1,14 +1,14 @@ use URI::Escape; class Perl6::Documentable { - has Str $.kind; # type, language doc, routine, module - has Str @.subkinds; # class/role/enum, sub/method, prefix/infix/... - has Str @.categories; # basic type, exception, operator... + has $.kind; # type, language doc, routine, module + has @.subkinds; # class/role/enum, sub/method, prefix/infix/... + has @.categories; # basic type, exception, operator... - has Str $.name; - has Str $.url; + has $.name; + has $.url; has $.pod; - has Bool $.pod-is-complete; - has Str $.summary = ''; + has $.pod-is-complete; + has $.summary = ''; # the Documentable that this one was extracted from, if any has $.origin; @@ -33,8 +33,8 @@ class Perl6::Documentable { method url() { $!url //= $.kind eq 'operator' - ?? "/language/operators#" ~ uri_escape("@.subkinds[] $.name".subst(/\s+/, '_', :g)) - !! ("", $.kind, $.name).map(&uri_escape).join('/') + ?? "/language/operators#" ~ uri_escape("@.subkinds[] {$.name.gist}".subst(/\s+/, '_', :g)) + !! ("", $.kind, $.name.gist).map(&uri_escape).join('/') ; } method categories() { diff --git a/lib/Pod/Htmlify.pm6 b/lib/Pod/Htmlify.pm6 index 4cee8858b..59db9489b 100644 --- a/lib/Pod/Htmlify.pm6 +++ b/lib/Pod/Htmlify.pm6 @@ -25,8 +25,9 @@ my \length = @badchars.elems; sub replace-badchars-with-goodnames($s is copy) is export { # return $s if $s ~~ m{^ <[a..z]>+ '://'}; # bail on external links + return "" unless $s; # Avoid issues with Any being passed in. TODO avoid passing it in! loop (my int $i = 0; $i < length; $i++) { - $s = $s.subst(@badchars[$i], goodnames[$i], :g) + $s = $s.gist.subst(@badchars[$i], goodnames[$i], :g) } $s