Skip to content

Commit 2d3d9a6

Browse files
committed
Fixed unduly generated line
The hack is that it's only generated if it's in the first 5 lines of a file. However, it would be much better if we looked at the file as a whole. Closes #2455
1 parent c3f2218 commit 2d3d9a6

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

doc/Language/pod.pod6

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
55
=SUBTITLE An easy-to-use markup language
66
7-
Perl 6 pod is an easy-to-use markup language. Pod can be used for writing
8-
language documentation, for documenting programs and modules, as well as for
9-
other types of document composition.
7+
Perl 6 pod is an easy-to-use markup language. Pod can be used for
8+
writing language documentation, for documenting programs and modules, as
9+
well as for other types of document composition.
1010
1111
Every Pod document has to begin with C<=begin pod> and end with C<=end pod>.
1212
Everything between these two delimiters will be processed and used to generate

util/manage-page-order.p6

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ sub write-Language-files() {
181181
my $to = "$todir/{$page-order}-{$fname}";
182182
say "DEBUG: to '$to'" if $debug;
183183
my $fh = open $to, :w;
184+
my $line-no = 1;
184185
for $from.IO.lines -> $line is copy {
185186
if $line ~~ /^ \h* '=begin' \h* pod / {
186187
# check any existing :page-order entry
@@ -189,12 +190,17 @@ sub write-Language-files() {
189190
}
190191
else {
191192
#$fh.say: "$line :page-order<{$page-order}>";
192-
$fh.say: "# THIS FILE IS AUTO-GENERATED--ALL EDITS WILL BE LOST";
193-
$fh.say: $line ~ " :link<$key-fname>";
194-
#$fh.say: "=comment THIS FILE IS AUTO-GENERATED--ALL EDITS WILL BE LOST";
193+
if $line-no < 5 {
194+
$fh.say: "# THIS FILE IS AUTO-GENERATED--ALL EDITS WILL BE LOST";
195+
$fh.say: $line ~ " :link<$key-fname>";
196+
#$fh.say: "=comment THIS FILE IS AUTO-GENERATED--ALL EDITS WILL BE LOST";
197+
} else {
198+
$fh.say: $line;
199+
}
195200
}
196201
next;
197202
}
203+
$line-no++;
198204
$fh.say: $line;
199205
}
200206
$fh.close;

0 commit comments

Comments
 (0)