Examples

Build Script

To use DocFX in your Cake file simply import it and the DocFX tool. Then define a doc task.

#addin "Cake.DocFx"
#tool "docfx.console"

Task("doc").Does(() => DocFxBuild());

IMPORTANT Do not forget to load '#tool "docfx.console"' at top of your Cake file. Otherwise, you can not run the DocFx() command.

If the docfx.json file is anywhere else then the root directory you can pass in the location as parameter.

#addin "Cake.DocFx"
#tool "docfx.console"

Task("doc").Does(() => DocFxBuild("./docs/docfx.json"));

IMPORTANT The DocFx command requires an existing docfx.json file. To bootstrap DocFX use docfx init or ./tools/docfx.console/tools/docfx.exe init.

GitHub
Discussions