__traits(documentation, X)
rikki cattermole
rikki at cattermole.co.nz
Wed Jan 17 02:28:45 UTC 2018
Just a fun bit of history:
A few years ago I looked into implementing this myself.
Discovering that without -D documentation is lost.
Why did I want to do this?
From memory it was to allow me to give greater control over exportation
of models+routes in Cmsed as part of documentation (or something along
those lines).
I wouldn't want to do it this way now, but it does still feel like a
hole in traits to me.
But imagine a use case of translations:
/**
* Translation_English:
* Foo bar
* Translation_X:
* SDFJL
*/
string welcome(Language language) {
return getSectionFromDDOC(__traits(comments, welcome), "Translation_" ~
language.text);
}
More information about the Digitalmars-d
mailing list