digitalmars.D - Suggestion: __traits(ddoc)
- James Lu (8/8) May 10 2021 DDoC is very convenient for generating HTML documentation.
- Adam D. Ruppe (2/4) May 10 2021 omg yes this would be SO useful for me.
- Vladimir Panteleev (9/14) May 10 2021 This has been proposed and implemented before, but it was not
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. I suggest `__traits(ddoc, symbol)`, which would return the concatenated DDoC source of a symbol as an enum string. If DMD compiler authors provide pointers (where to start, what methods to call) on how to do this, I will implement this myself and send a pull request.
May 10 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.omg yes this would be SO useful for me.
May 10 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.orgDDoC 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
May 10 2021