Skip to content

Commit 0ebf8df

Browse files
committed
Document the preferred Phobos documentation style
1 parent 929d6a7 commit 0ebf8df

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

dstyle.dd

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,38 @@ class MyClass
395395
-------------------------------
396396
)
397397

398+
$(LISTSECTION phobos_documentation, Documentation,
399+
$(LI Every public symbol be exposed on the documentation:)
400+
---
401+
/// A public symbol
402+
enum myFancyConstant;
403+
---
404+
$(LI Every public function should have a Ddoc description and documented
405+
`Params:` and `Returns:` sections (if applicable):)
406+
---
407+
/**
408+
Checks whether a number is positive.
409+
`0` isn't considered as positive number.
410+
411+
Params:
412+
number = number to be checked
413+
414+
Returns: `true` if the number is positive, `0` otherwise.
415+
416+
See_Also: $(LREF isNegative)
417+
*/
418+
bool isPositive(int number)
419+
{
420+
return number > 0;
421+
}
422+
---
423+
$(LI Text in sections (e.g. `Params:`, `Returns:`, `See_Also`) should be indented by one level if spans more than the line of the section.)
424+
$(LI Documentation comments should not use more than two stars `/**` in the header line.)
425+
$(LI Block comments (`/**`) should be used - not nesting block comments (`/++`))
426+
$(LI Global functions shouldn't indent their documentation block nor use stars as indentation.)
427+
$(LI Text example blocks should use three dashes (`---`) only.)
428+
)
429+
398430
$(BR)
399431
$(P
400432
We are not necessarily recommending that all code follow these rules.

0 commit comments

Comments
 (0)