Looks like you'll need to use dmd as a library and run the ddoc generator manually. Here is where its being called from: https://github.com/dlang/dmd/blob/master/compiler/src/dmd/main.d#L682 My only concern is its running after semantic analysis. I don't know how good the output will be without it.