Skip to content

Commit a7f74fe

Browse files
authored
Merge pull request #1192 from perl6/contributing-examples-style
Contributing examples output style explanation
2 parents 4375633 + 46ffe0d commit a7f74fe

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ Fill the documentation file `doc/Type/MyFunnyRole.pod6` like this:
8282

8383
=head2 method do-it
8484

85-
method do-it(Int $how-often) returns Nil:D
85+
method do-it(Int $how-often --> Nil:D)
8686

8787
Method description here
8888

89-
MyFunnyRole.do-it(2); # example output
89+
MyFunnyRole.do-it(2); # OUTPUT: «example output␤»
9090

9191

9292
When documenting a pair of a sub and a method which both do the same thing, the
@@ -96,6 +96,15 @@ more lines with the signatures. Other allowed words instead of `method` are
9696
`term`. If you wish to hide a heading from any index prefix it with the empty
9797
comment `Z<>`.
9898

99+
When providing a code example result or output, use this style:
100+
101+
# For the result of an expression.
102+
1 + 2; # RESULT: «3»
103+
# For the output.
104+
say 1 + 3; # OUTPUT: «3␤»
105+
# For the explanatory comment
106+
do-work; # We call do-work sub
107+
99108
## Running tests
100109

101110
Any contributions should pass the `make test` target. This insures basic

0 commit comments

Comments
 (0)