This is an alternative documentation generator for programs written in the D programming language. It aims to be fully compatible with Ddoc (the documentation generator built into the D compiler). Additional features include:
For real world examples see the vibe.d API documentation and the D standard library documentation.
-D -X -Xfdocs.json
to your DMD command line (Note that you may need to clean up all the generated .html files afterwards)dub build
from its root folderNote that DDOX uses vibe.d, which currently by default uses libevent as its core. Please follow its installation instructions, too, if necessary.
You can filter the JSON file using ddox filter <path_to_json>
.
The following command will filter out all modules starting with "core.sync.", except those starting with "core.sync.mutex" or "core.sync.condition". --in
always takes precedence over --ex
here. Additionally, all members with a protection lower than public will be filtered out.
./ddox filter path/to/docs.json --ex core.sync. --in core.sync.mutex --in core.sync.condition --min-protection Public
Ensure your current working directory contains ddox's directory "public", or a modified version of it (otherwise the CSS stylings and JavaScript extras won't work).
cd path/to/ddox
Then, simply run the following command and go to http://127.0.0.1:8080/
./ddox serve-html path/to/docs.json
The following commands will generate HTML docs (along with the default CSS stylings and JavaScript extras) in the folder "destination/path/public":
cp -r path/to/ddox/public destination/path
./ddox generate-html path/to/docs.json destination/path/public
Documentation for DUB projects can be built as simple as by running the following command within the project's directory:
dub build -b ddox
The "-ddoxFilterArgs"
field in dub.json
(resp. x:ddoxFilterArgs
in dub.sdl
) can be used to customize the included contents.
Quickly serving the documentation on a local HTTP server, which is usually faster than writing out all HTML files to disk, is also possible:
dub run -b ddox
Apart from the standard set of predefined macros, DDOX defines a macro DDOX_ROOT_DIR
, which contains the relative path to the root of the documentation hierarchy (ending with a slash). It can be used to link to resources that reside in a fixed location within the same directory tree.
There are a number of issues due to limitations of the JSON output that DMD generates:
static if
are not shown (issues #19 and #86)