Configuration
π Supported Output Formats
DocBox offers several built-in output formats as well as enabling you to create your own:
π HTML - Modern HTML documentation with two theme options
π JSON - Machine-readable JSON format
π UML - XMI/UML diagram generation
Each format is configured by its alias name, such as "JSON", "HTML", or "XMI".
var docbox = new docbox.DocBox();
docbox.addStrategy( "UML", { outputFile : "./tmp/docs/app-diagram.uml" })βοΈ Basic Configuration
π― Single Strategy
new docbox.DocBox()
.addStrategy( "HTML", {
projectTitle : "My API Documentation",
outputDir : expandPath( './docs' ),
theme : "default" // or "frames"
} )
.generate(
source = expandPath( "/app" ),
mapping = "app",
excludes = "(tests|build)"
);π Multiple Strategies
You can call the .addStrategy() method multiple times to generate multiple output formats:
π¨ HTML Strategy Options (New in 5.0)
The HTML strategy now supports theme selection:
β¨ Theme Features
Default Theme:
β‘ Alpine.js SPA architecture
π Dark mode toggle with persistence
π Real-time method search
π Tabbed method summaries
π Modern purple gradient design
π― Bootstrap 5 components
Frames Theme:
π± Traditional three-panel frameset
ποΈ Left sidebar navigation
π¨ Bootstrap 5 styling
π Dark mode support
π Classic documentation UX
π§ Generate Method Parameters
The generate() method accepts the following parameters:
source: A path to the source location or an array of structs of locations that must have adirandmappingkeymapping: The base mapping for the folder source (used only ifsourceis a path)excludes: A regular expression that will be evaluated against all CFCs. If the regex matches the CFC name and path, the CFC will be excluded
π Single Source
π Multiple Sources
π₯ BoxLang CLI Usage (New in 5.0)
DocBox 5.0 includes a native BoxLang CLI module:
See boxlang module:docbox --help for complete CLI documentation.
β»οΈ Backwards Compatibility
For backwards compatibility, specifying the full class path is still supported, as is specifying a single strategy when initializing DocBox:
Last updated
Was this helpful?