Skip to content

Commit 1a8dfe3

Browse files
committed
Update .content calls to .contents
1 parent f2d8873 commit 1a8dfe3

File tree

3 files changed

+35
-35
lines changed

3 files changed

+35
-35
lines changed

htmlify.p6

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,13 @@ sub process-pod-dir($dir, :$dr, :&sorted-by = &[cmp]) {
173173
multi process-pod-source(:$what where "language", :$dr, :$pod, :$podname, :$pod-is-complete) {
174174
my $name = $podname;
175175
my $summary = '';
176-
if $pod.content[0] ~~ {$_ ~~ Pod::Block::Named and .name eq "TITLE"} {
177-
$name = $pod.content[0].content[0].content[0]
176+
if $pod.contents[0] ~~ {$_ ~~ Pod::Block::Named and .name eq "TITLE"} {
177+
$name = $pod.contents[0].contents[0].contents[0]
178178
} else {
179179
note "$podname does not have an =TITLE";
180180
}
181-
if $pod.content[1] ~~ {$_ ~~ Pod::Block::Named and .name eq "SUBTITLE"} {
182-
$summary = $pod.content[1].content[0].content[0];
181+
if $pod.contents[1] ~~ {$_ ~~ Pod::Block::Named and .name eq "SUBTITLE"} {
182+
$summary = $pod.contents[1].contents[0].contents[0];
183183
} else {
184184
note "$podname does not have an =SUBTITLE";
185185
}
@@ -227,9 +227,9 @@ multi write-type-source($doc) {
227227
an imgage showing the type relations for $podname. If not, try the <a
228228
href="/images/type-graph-{uri_escape $podname}.png">PNG
229229
version</a>.</p>];
230-
$pod.content.push: Pod::Raw.new(
230+
$pod.contents.push: Pod::Raw.new(
231231
target => 'html',
232-
content => $tg-preamble ~ svg-for-file("html/images/type-graph-$podname.svg"),
232+
contents => $tg-preamble ~ svg-for-file("html/images/type-graph-$podname.svg"),
233233

234234
);
235235

@@ -238,7 +238,7 @@ multi write-type-source($doc) {
238238

239239
for $type.roles -> $r {
240240
next unless %methods-by-type{$r};
241-
$pod.content.push:
241+
$pod.contents.push:
242242
pod-heading("Methods supplied by role $r"),
243243
pod-block(
244244
"$podname does role ",
@@ -250,7 +250,7 @@ multi write-type-source($doc) {
250250
}
251251
for @mro -> $c {
252252
next unless %methods-by-type{$c};
253-
$pod.content.push:
253+
$pod.contents.push:
254254
pod-heading("Methods supplied by class $c"),
255255
pod-block(
256256
"$podname inherits from class ",
@@ -261,7 +261,7 @@ multi write-type-source($doc) {
261261
;
262262
for $c.roles -> $r {
263263
next unless %methods-by-type{$r};
264-
$pod.content.push:
264+
$pod.contents.push:
265265
pod-heading("Methods supplied by role $r"),
266266
pod-block(
267267
"$podname inherits from class ",
@@ -286,7 +286,7 @@ sub find-definitions (:$pod, :$origin, :$dr, :$min-level = -1) {
286286
# If a heading is a definition, like "class FooBar", process
287287
# the class and give the rest of the pod to find-definitions,
288288
# which will return how far the definition of "class FooBar" extends.
289-
my @c := $pod ~~ Positional ?? @$pod !! $pod.content;
289+
my @c := $pod ~~ Positional ?? @$pod !! $pod.contents;
290290
my int $i = 0;
291291
my int $len = +@c;
292292
while $i < $len {
@@ -297,8 +297,8 @@ sub find-definitions (:$pod, :$origin, :$dr, :$min-level = -1) {
297297
# Is this new header a definition?
298298
# If so, begin processing it.
299299
# If not, skip to the next heading.
300-
$i = $i + 1 and next unless $c.content[0].content[0] ~~ Str
301-
and 2 == my @words = $c.content[0].content[0].words;
300+
$i = $i + 1 and next unless $c.contents[0].contents[0] ~~ Str
301+
and 2 == my @words = $c.contents[0].contents[0].words;
302302

303303
my ($subkinds, $name) = @words;
304304
my %attr;
@@ -333,7 +333,7 @@ sub find-definitions (:$pod, :$origin, :$dr, :$min-level = -1) {
333333
# And updating $i to be after the places we've already searched
334334
my int $new-i = $i + find-definitions :pod(@c[$i+1..*]), :origin($created), :$dr, :min-level(@c[$i].level);
335335

336-
@c[$i].content[0] = pod-link "$subkinds $name",
336+
@c[$i].contents[0] = pod-link "$subkinds $name",
337337
$created.url ~ "#$origin.human-kind() $origin.name()".subst(:g, /\s+/, '_');
338338

339339
my $chunk = $created.pod.push: pod-lower-headings(@c[$i..$new-i], :to(%attr<kind> eq 'type' ?? 0 !! 2));
@@ -475,22 +475,22 @@ sub write-disambiguation-files($dr) {
475475
if $p.elems == 1 {
476476
$p = $p[0] if $p ~~ Array;
477477
if $p.origin -> $o {
478-
$pod.content.push:
478+
$pod.contents.push:
479479
pod-block(
480480
pod-link("'$name' is a $p.human-kind()", $p.url),
481481
' from ',
482482
pod-link($o.human-kind() ~ ' ' ~ $o.name, $o.url),
483483
);
484484
}
485485
else {
486-
$pod.content.push:
486+
$pod.contents.push:
487487
pod-block(
488488
pod-link("'$name' is a $p.human-kind()", $p.url)
489489
);
490490
}
491491
}
492492
else {
493-
$pod.content.push:
493+
$pod.contents.push:
494494
pod-block("'$name' can be anything of the following"),
495495
$p.map({
496496
if .origin -> $o {

lib/Pod/Convenience.pm6

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ sub pod-gist(Pod::Block $pod, $level = 0) is export {
1111
}
1212
}
1313
@chunks = $leading, $pod.^name, (%confs.perl if %confs), "\n";
14-
for $pod.content.list -> $c {
14+
for $pod.contents.list -> $c {
1515
if $c ~~ Pod::Block {
1616
@chunks.push: pod-gist($c, $level + 2);
1717
}
@@ -32,15 +32,15 @@ sub pod-gist(Pod::Block $pod, $level = 0) is export {
3232

3333
sub first-code-block(@pod) is export {
3434
if @pod[1] ~~ Pod::Block::Code {
35-
return @pod[1].content.grep(Str).join;
35+
return @pod[1].contents.grep(Str).join;
3636
}
3737
'';
3838
}
3939

4040
sub pod-with-title($title, *@blocks) is export {
4141
Pod::Block::Named.new(
4242
name => "pod",
43-
content => [
43+
contents => [
4444
pod-title($title),
4545
@blocks.flat,
4646
]
@@ -50,37 +50,37 @@ sub pod-with-title($title, *@blocks) is export {
5050
sub pod-title($title) is export {
5151
Pod::Block::Named.new(
5252
name => "TITLE",
53-
content => Array.new(
53+
contents => Array.new(
5454
Pod::Block::Para.new(
55-
content => [$title],
55+
contents => [$title],
5656
)
5757
)
5858
)
5959
}
6060

61-
sub pod-block(*@content) is export {
62-
Pod::Block::Para.new(:@content);
61+
sub pod-block(*@contents) is export {
62+
Pod::Block::Para.new(:@contents);
6363
}
6464

6565
sub pod-link($text, $url) is export {
6666
Pod::FormattingCode.new(
67-
type => 'L',
68-
content => [$text],
69-
meta => [$url],
67+
type => 'L',
68+
contents => [$text],
69+
meta => [$url],
7070
);
7171
}
7272

7373
sub pod-bold($text) is export {
7474
Pod::FormattingCode.new(
75-
type => 'B',
76-
content => [$text],
75+
type => 'B',
76+
contents => [$text],
7777
);
7878
}
7979

80-
sub pod-item(*@content, :$level = 1) is export {
80+
sub pod-item(*@contents, :$level = 1) is export {
8181
Pod::Item.new(
8282
:$level,
83-
:@content,
83+
:@contents,
8484
);
8585
}
8686

@@ -91,9 +91,9 @@ sub pod-heading($name, :$level = 1) is export {
9191
);
9292
}
9393

94-
sub pod-table(@content) is export {
94+
sub pod-table(@contents) is export {
9595
Pod::Block::Table.new(
96-
:@content
96+
:@contents
9797
)
9898
}
9999

@@ -103,7 +103,7 @@ sub pod-lower-headings(@content, :$to = 1) is export {
103103
return @content unless $by > $to;
104104
for @content {
105105
@new-content.push($_ ~~ Pod::Heading
106-
?? Pod::Heading.new :level(.level - $by + $to) :content[.content]
106+
?? Pod::Heading.new :level(.level - $by + $to) :contents[.contents]
107107
!! $_
108108
);
109109
}

lib/Pod/To/SectionFilter.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ use Pod::To::Text;
22
class Pod::To::SectionFilter {
33
method render(@pod) {
44
my $search_for = %*ENV<PERL6_POD_HEADING> // die 'env var missing';
5-
my @blocks := @pod[0].content;
5+
my @blocks := @pod[0].contents;
66
my $from;
77
my $heading-level;
88
for @blocks.kv -> $idx, $b {
9-
if $b ~~ Pod::Heading && $b.content[0].content[0] ~~ m:i:s/^ [method|sub|routine] $search_for $/ {
9+
if $b ~~ Pod::Heading && $b.contents[0].contents[0] ~~ m:i:s/^ [method|sub|routine] $search_for $/ {
1010
$from = $idx;
1111
$heading-level = $b.level;
1212
}

0 commit comments

Comments
 (0)