Bug 9758 – Ddoc: empty ddoc comment and unittest block generates no Examples section
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-19T08:24:00Z
Last change time
2013-03-19T23:38:13Z
Keywords
ddoc, pull
Assigned to
andrej.mitrovich
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2013-03-19T08:24:08Z
From the discussion in https://github.com/D-Programming-Language/dmd/pull/1765
Currently, this code:
/// test
void foo(){}
///
unittest { }
Will generate:
void foo();
test
There is no "Examples:" section, because unittest block has empty ddoc comment and code block. But I think generating "Examples:" section is sometimes useful, even if there is no text. For example making placeholder to represent necessity of later documentation writing.
Comment #1 by andrej.mitrovich — 2013-03-19T20:51:53Z
I agree, now that unittest comments are being emitted it makes sense:
/// test
void foo(){}
/// placeholder
unittest { }
Results in:
void foo();
test
Examples:
placeholder
Comment #2 by andrej.mitrovich — 2013-03-19T20:52:07Z