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 a dir and mapping key

  • mapping : The base mapping for the folder source (used only if source is 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?