|
| 1 | +Your patches to perl6/doc are very welcome. |
| 2 | + |
| 3 | +They are even more welcome if you stick to our style and formatting |
| 4 | +guidelines. |
| 5 | + |
| 6 | +## General principles |
| 7 | + |
| 8 | +* Please use the present tense. |
| 9 | +* Link to external resources (like Wikipedia) for topics that are not |
| 10 | + directly related to Perl 6 (like the math that our routines implement) |
| 11 | +* Duplicate small pieces of information rather than rely on linking |
| 12 | +* Be explicit about routine signatures. If a method accepts a `*%args`, |
| 13 | + but treats some of them special, list them separately. |
| 14 | + |
| 15 | +## Documenting types |
| 16 | + |
| 17 | +Types should be documented like this (the tool `util/new-type.p6` can create |
| 18 | +the skeleton for you): |
| 19 | + |
| 20 | + =TITLE role MyFunnyRole |
| 21 | + |
| 22 | + =SUBTITLE Sentence or half-sentence about what it does |
| 23 | + |
| 24 | + role MyFunnyRole does OtherRole is SuperClass { ... } |
| 25 | + |
| 26 | + Longer description here about what this type is, and |
| 27 | + how you can use it. |
| 28 | + |
| 29 | + # usage example goes here |
| 30 | + |
| 31 | + =head1 Methods |
| 32 | + |
| 33 | + =head2 method do-it |
| 34 | + |
| 35 | + method do-it(Int $how-often) returns Nil:D |
| 36 | + |
| 37 | + Method description here |
| 38 | + |
| 39 | + MyFunnyRole.do-it(2); # example output |
| 40 | + |
| 41 | + |
| 42 | +When documeting a pair of a sub and a method which both do the same thing, |
| 43 | +the heading should be `=head2 routine do-it`, and the next thing should be two |
| 44 | +or more lines with the signatures. Other allowed words instead of `method` |
| 45 | +are `sub`, `trait`, `infix`, `prefix`, `postfix`, `circumfix`, |
| 46 | +`postcircumfix`, `term`. |
0 commit comments