DocBox offers several built-in output formats as well as enabling you to create your own:
Each format is configured by its alias name, such as "JSON"
or "HTML"
.
var docbox = new docbox.DocBox();
docbox.addStrategy( "UML", { outputFile : "./tmp/docs/app-diagram.uml" })
For backwards compatibility, specifying the full class path is still supported, as is specifying a single strategy when initializing DocBox:
variables.docbox = new docbox.DocBox(
strategy = "docbox.strategy.uml2tools.XMIStrategy",
properties={
projectTitle = "DocBox Tests",
outputFile = variables.testOutputFile
}
);
new docbox.DocBox()
.addStrategy( "HTML", {
projectTitle : "CommandBox",
outputDir : expandPath( './docs' )
} )
.generate(
source = expandPath( "/app" ),
mapping = "app",
excludes="(coldbox)"
);
You can call the .addStrategy()
method multiple times to specify multiple output formats:
new docbox.DocBox()
.addStrategy( "HTML", {
projectTitle="My Docs",
outputDir="#expandPath( '/docs/html' )#"
} )
.addStrategy( "JSON", {
projectTitle="My Docs",
outputDir="#expandPath( '/docs/json' )#"
} )
.generate(
source = expandPath( "/app" ),
mapping = "app",
excludes="(coldbox)"
);