Suggestion: __traits(ddoc)

Vladimir Panteleev thecybershadow.lists at gmail.com
Tue May 11 03:30:28 UTC 2021


On Tuesday, 11 May 2021 at 00:00:30 UTC, James Lu wrote:
> I suggest `__traits(ddoc, symbol)`, which would return the 
> concatenated DDoC source of a symbol as an enum string.

This has been proposed and implemented before, but it was not 
accepted into the language. See:

- https://github.com/dlang/dmd/pull/3531
- https://github.com/dlang/dmd/pull/6872
- 
https://forum.dlang.org/post/qsnyzyrgyftpxxskrqaj@forum.dlang.org

> DDoC is very convenient for generating HTML documentation.
>
> Sometimes, though, we need to print documentation back, for 
> example when writing a command line tool and "-h" is passed.

This is the same use case I had:

https://github.com/dlang/dmd/pull/6872#issuecomment-307109065



More information about the Digitalmars-d mailing list