How to write document for methods under static if?

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Mar 10 05:53:35 PST 2017


On Friday, 10 March 2017 at 12:49:42 UTC, Yuxuan Shui wrote:
> What's the proper way to write document in this case?

ddoc and ddox are both built on dmd which generates code based on 
the compile... so it will only show that which actually pass the 
static if.

You might want to try my doc gen, the result is this:

http://dpldocs.info/experimental-docs/test.sif.html

IMPORTANT: you MUST add a module declaration with a doc comment 
for my thing to process it. So at the top of the file, write:

///
module whatever.name.you.want;


To enable generation. You can write more too, that comment 
creates the homepage.


Anyway, if you want to try my generator, here it is:

https://github.com/adamdruppe/adrdox


Instructions:

1) git clone https://github.com/adamdruppe/adrdox.git
2) make
3) edit skeleton.html to customize the header text, etc. Don't 
change it too much, but the logo and name are easy changes.

4) Run `./doc2 yourcode.d` or `./doc2 your/project/src/dir`
5) open generated-docs/something.html in your browser



It isn't perfect on static ifs, it doesn't tell you what the 
condition is, but it does at least generate them.

let me know how it works if you decide to try it.


More information about the Digitalmars-d-learn mailing list