diff --git a/assets/sass/style.scss b/assets/sass/style.scss index b616546e2..105dfa422 100644 --- a/assets/sass/style.scss +++ b/assets/sass/style.scss @@ -78,7 +78,7 @@ table.pod-table tr:nth-child(odd) { background-color: rgba(0, 0, 0, 0.031373); } table.pod-table tr:nth-child(even) { - background-color: none; + background-color: transparent; } td, th { @@ -91,7 +91,7 @@ td, th { .pretty-box { border: 0.2em solid; - background-style: solid; + border-style: solid; border-radius: 1em; box-shadow: 0.5em 0.5em 1em #888888; padding: 2em; diff --git a/doc/Language/operators.pod6 b/doc/Language/operators.pod6 index f63e43073..bb56ed159 100644 --- a/doc/Language/operators.pod6 +++ b/doc/Language/operators.pod6 @@ -133,7 +133,7 @@ performs I (i.e., I behaviour; and an uppercase form (e.g., C) that provides a I behavior. -=head2 C in-place substitution +=head2 X«C in-place substitution» my $str = 'old string'; $str ~~ s/o .+ d/new/; @@ -175,7 +175,7 @@ Non-paired characters can simply replace the original slashes. Paired characters, like braces, are used only on the match portion, with the substitution given by assignment (of anything: a string, a routine call, etc.). -=head2 C non-destructive substitution +=head2 X«C non-destructive substitution» say S/o .+ d/new/ with 'old string'; # OUTPUT: «new string␤» S:g/« (.)/$0.uc()/.say for ; # OUTPUT: «Foo␤Bar␤Ber␤» @@ -191,7 +191,7 @@ warning. To execute the substitution on a variable that isn't the C<$_> this operator uses, alias it to C<$_> with C, C, or any other way. Alternatively, use the L«C<.subst> method|/routine/subst». -=head2 C in-place transliteration +=head2 X«C in-place transliteration» my $str = 'old string'; $str ~~ tr/dol/wne/; @@ -209,7 +209,7 @@ that measures the distance between original value and the resultant string. $str ~~ tr:c:d/dol st//; say $str; # OUTPUT: «ring␤» -=head2 C non-destructive transliteration +=head2 X«C non-destructive transliteration» with 'old string' { say TR/dol/wne/; # OUTPUT: «new string␤» diff --git a/htmlify.p6 b/htmlify.p6 index ca96fbf59..2e2ae0ccf 100755 --- a/htmlify.p6 +++ b/htmlify.p6 @@ -266,11 +266,11 @@ sub process-pod-dir($dir, :&sorted-by = &[cmp], :$sparse, :$parallel) { } if $num %% $parallel { - await Promise.allof: @pod-files; + await @pod-files; @pod-files = (); } - LAST await Promise.allof: @pod-files; + LAST await @pod-files; } } @@ -450,12 +450,12 @@ sub register-reference(:$pod!, :$origin, :$url) { for @( $pod.meta ) -> $meta { my $name; if $meta.elems > 1 { - my $last = $meta[*-1]; - my $rest = $meta[0..*-2].join; + my $last = textify-guts $meta[*-1]; + my $rest = $meta[0..*-2]».&textify-guts.join; $name = "$last ($rest)"; } else { - $name = $meta.Str; + $name = textify-guts $meta; } $*DR.add-new( :$pod, @@ -474,11 +474,19 @@ sub register-reference(:$pod!, :$origin, :$url) { :$url, :kind, :subkinds['reference'], - :$name, + :name(textify-guts $name), ); } } +multi textify-guts (Any:U, ) { '' } +multi textify-guts (Str:D \v) { v } +multi textify-guts (List:D \v) { v».&textify-guts.Str } +multi textify-guts (Pod::Block \v) { + use Pod::To::Text; + pod2text v; +} + #| A one-pass-parser for pod headers that define something documentable. sub find-definitions(:$pod, :$origin, :$min-level = -1, :$url) { # Runs through the pod content, and looks for headings. @@ -510,18 +518,20 @@ sub find-definitions(:$pod, :$origin, :$min-level = -1, :$url) { when :(Pod::FormattingCode $) { my $fc := .[0]; proceed unless $fc.type eq "X"; - @definitions = $fc.meta[0].flat; + (@definitions = $fc.meta[0]:v.flat) ||= ''; # set default name if none provide so X gets name 'if' - @definitions[1] = $fc.contents[0] if @definitions == 1; + @definitions[1] = textify-guts $fc.contents[0] + if @definitions == 1; $unambiguous = True; } # XXX: Remove when extra "" have been purged when :("", Pod::FormattingCode $, "") { my $fc := .[1]; proceed unless $fc.type eq "X"; - @definitions = $fc.meta[0].flat; + (@definitions = $fc.meta[0]:v.flat) ||= ''; # set default name if none provide so X gets name 'if' - @definitions[1] = $fc.contents[0] if @definitions == 1; + @definitions[1] = textify-guts $fc.contents[0] + if @definitions == 1; $unambiguous = True; } when :(Str $ where /^The \s \S+ \s \w+$/) { @@ -538,15 +548,15 @@ sub find-definitions(:$pod, :$origin, :$min-level = -1, :$url) { } when :("The ", Pod::FormattingCode $, Str $ where /^\s (\w+)$/) { # The C infix - @definitions = .[2].words[0], .[1].contents[0]; + @definitions = .[2].words[0], textify-guts .[1].contents[0]; } when :(Str $ where /^(\w+) \s$/, Pod::FormattingCode $) { # infix C - @definitions = .[0].words[0], .[1].contents[0]; + @definitions = .[0].words[0], textify-guts .[1].contents[0]; } # XXX: Remove when extra "" have been purged when :(Str $ where /^(\w+) \s$/, Pod::FormattingCode $, "") { - @definitions = .[0].words[0], .[1].contents[0]; + @definitions = .[0].words[0], textify-guts .[1].contents[0]; } default { next } } @@ -669,13 +679,13 @@ sub write-type-graph-images(:$force, :$parallel) { my $viz = Perl6::TypeGraph::Viz.new-for-type($type); @type-graph-images.push: $viz.to-file("html/images/type-graph-{$type}.svg", format => 'svg'); if @type-graph-images %% $parallel { - await Promise.allof: @type-graph-images; + await @type-graph-images; @type-graph-images = (); } print '.'; - LAST await Promise.allof: @type-graph-images; + LAST await @type-graph-images; } say ''; @@ -692,11 +702,11 @@ sub write-type-graph-images(:$force, :$parallel) { :rank-dir('LR')); @specialized-visualizations.push: $viz.to-file("html/images/type-graph-{$group}.svg", format => 'svg'); if @specialized-visualizations %% $parallel { - await Promise.allof: @specialized-visualizations; + await @specialized-visualizations; @specialized-visualizations = (); } - LAST await Promise.allof: @specialized-visualizations; + LAST await @specialized-visualizations; } } diff --git a/template/search_template.js b/template/search_template.js index 35471a0ec..05c4ea921 100644 --- a/template/search_template.js +++ b/template/search_template.js @@ -169,7 +169,7 @@ $.extend( $.ui.autocomplete, { current_search = term.toLowerCase(); var search_method = false; - if (term.startsWith(".")) { + if (term.match(/^\s*\.[a-zA-Z][a-zA-Z0-9_-]+\s*$/)) { search_method = true; term = term.substr(1); }