DocBox
Search…
Configuration

Supported Output Formats

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".
1
var docbox = new docbox.DocBox();
2
docbox.addStrategy( "UML", { outputFile : "./tmp/docs/app-diagram.uml" })
Copied!

Backwards Compatibility

For backwards compatibility, specifying the full class path is still supported, as is specifying a single strategy when initializing DocBox:
1
variables.docbox = new docbox.DocBox(
2
strategy = "docbox.strategy.uml2tools.XMIStrategy",
3
properties={
4
projectTitle = "DocBox Tests",
5
outputFile = variables.testOutputFile
6
}
7
);
Copied!
1
new docbox.DocBox()
2
.addStrategy( "HTML", {
3
projectTitle : "CommandBox",
4
outputDir : expandPath( './docs' )
5
} )
6
.generate(
7
source = expandPath( "/app" ),
8
mapping = "app",
9
excludes="(coldbox)"
10
);
Copied!

Generating Multiple Outputs

You can call the .addStrategy() method multiple times to specify multiple output formats:
1
new docbox.DocBox()
2
.addStrategy( "HTML", {
3
projectTitle="My Docs",
4
outputDir="#expandPath( '/docs/html' )#"
5
} )
6
.addStrategy( "JSON", {
7
projectTitle="My Docs",
8
outputDir="#expandPath( '/docs/json' )#"
9
} )
10
.generate(
11
source = expandPath( "/app" ),
12
mapping = "app",
13
excludes="(coldbox)"
14
);
Copied!
Last modified 8mo ago