Skip to content

Commit 7850cd0

Browse files
committed
More exceptions for header capitalization
1 parent 8399f86 commit 7850cd0

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

t/08-headings.t

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ for @files -> $file {
2727
# proper names, macros, acronyms, and other exceptions
2828
$title ~~ s:g/ <|w> (
2929
I
30-
| Perl 6 | Pod 6 | P6
30+
| Perl 6 | Pod 6 | P6 | C3
3131
| AST | EVAL | PRE | POST | CLI | MOP
32-
| TITLE | SUBTITLE
32+
| TITLE | SUBTITLE | "MONKEY-TYPING"
3333
| API | TCP | UDP | FAQ
3434
| Javascript | Node | Haskell | Python | Ruby | C
3535
| "Input/Output" | "I/O"
@@ -43,10 +43,10 @@ for @files -> $file {
4343
| Whatever
4444
| ( <:Lu><:L>+ "::" )+ <:Lu><:L>+
4545
# these seem fishy?
46-
| Socket | Integer
46+
| Socket
4747
) <|w> //;
4848
$title ~~ s:g/ <|w> <[ C ]> \< .*? \> //;
49-
# ignore known classes like "Real" which are capitalized
49+
# ignore known classes like "Real" and "Date" which are capitalized
5050
my @words = $title ~~ m:g/ <|w> ( <:Lu> \S+ ) /;
5151
for @words -> $word {
5252
# if it exists, skip it
@@ -55,10 +55,12 @@ for @files -> $file {
5555
$title ~~ s:g/ << $word >> //;
5656
}
5757
}
58-
# sentence case: all lowercase, titlecase for first character
59-
if $title !~~ $title.lc.tc {
58+
# sentence case: all lowercase, titlecase for first
59+
# character except for cases where the first word is a
60+
# uncapitalized name of a program
61+
if $title !~~ $title.lc.tc and $title !~~ /^ p6doc / {
6062
@lines.push($line-no);
61-
@examples.push($title);
63+
@examples.push($line);
6264
}
6365
}
6466
}

0 commit comments

Comments
 (0)