Only this pageAll pages
Powered by GitBook
1 of 17

DocBox

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Getting Started

Loading...

Loading...

Loading...

Loading...

Output Formats

Loading...

Loading...

Loading...

Loading...

Loading...

Release History

A brief history in time of our major releases

In this section, you will find the release notes for each version we release under this major version. If you are looking for the release notes of previous major versions, use the version switcher at the top left of this documentation book. Here is a breakdown of our major version releases.

Version 5.0

Major release adding full BoxLang support, modern HTML themes with dark mode, enhanced UI/UX with real-time search, complete relationship documentation, and comprehensive developer experience improvements.

Version 4.0

This major bump was to deprecate some CFML engines

Version 3.0

Added a JSON strategy in preparation for multiple output strategies we will support. Updated build processes and a new outlook for the future of the project.

Version 2.0

The migration from ColdDoc into DocBox.

Introduction

DocBox is a JavaDoc-style documentation generator for your BoxLang and CFML Applications codebase

📚 DocBox reads component metadata and structured comments and outputs documentation in an HTML, JSON, or UML (diagram) format.

💻 System Requirements

  • BoxLang 1.0+

  • Lucee 5+

  • Adobe ColdFusion 2018+

🔢 Versioning

DocBox is maintained under the guidelines as much as possible. Releases will be numbered in the following format:

And constructed with the following guidelines:

  • Breaking backward compatibility bumps the major (and resets the minor and patch)

  • New additions without breaking backward compatibility bumps the minor (and resets the patch)

  • Bug fixes and misc changes bumps the patch

📄 License

Apache 2 License: ​

🔗 Important Links

  • 💻 Code: ​

  • 🐛 Issues:

  • 💬 Community:

💼 Professional Open Source

DocBox is professional open source software backed by offering services like:

  • 🛠️ Custom Development

  • 🎯 Professional Support & Mentoring

  • 📖 Training

  • ⚡ Server Tuning

HONOR GOES TO GOD ABOVE ALL

Because of His grace, this project exists. If you don't like this, don't read it; it's not for you.

"Therefore being justified by faith, we have peace with God through our Lord Jesus Christ: By whom also we have access by faith into this grace wherein we stand, and rejoice in hope of the glory of God." Romans 5:5

🔒 Security Hardening

  • 👀 Code Reviews

  • 🚀 Much More

  • Semantic Versioning
    http://www.apache.org/licenses/LICENSE-2.0
    https://github.com/ortus-solutions/docbox
    https://ortussolutions.atlassian.net/jira/software/c/projects/DOCBOX/issues/
    https://community.ortussolutions.com/
    Ortus Solutions, Corp
    Ortus Solutions, Corp
    <major>.<minor>.<patch>

    What's New With 4.0.0

    BREAKING

    • Dropped support for Adobe 2016. Adobe doesn't support ACF 16 anymore, so neither do we.

    NEW

    • Added support for Adobe 2021

    • Added support for @myCustomTag custom docblock tags on methods. (Already supported on components and properties, but missing on methods).

    • Added GitHub Actions CI for automated testing, format checking, releases and more

    FIX

    • Fixes support for Adobe 2018. (Mainly in the CommandBox strategy.)

    Custom Output

    🛠️ In addition to the mainstream output formats, you can extend DocBox's AbstractTemplateStrategy component to generate your own custom-formatted documentation:

    component extends="docbox.strategy.AbstractTemplateStrategy" accessors="true"{
       /**
        * Generate JSON documentation
        *
        * @metadata All component metadata, sourced from DocBox.
        */
       component function run( required query metadata ){
          // generate custom documentation format from arguments.metadata
       }
    }

    JSON Output

    Generate JSON output for easy documentation imports into other documentation tools and platforms.

    📋 Generate machine-readable JSON documentation for easy imports into other documentation tools and platforms.

    🚀 Instantiate DocBox

    Begin by creating an instance of DocBox:

    docbox = new DocBox();

    ⚙️ Properties

    The following are the properties for this strategy:

    • projectTitle : Used in the top-level overview-summary.json file

    • outputDir : The output directory absolute path

    Just pass them in the docbox.addStrategy() call:

    📝 Generate Documentation

    Now that you have an instance of DocBox configured with your strategy and its properties, just execute the generate() method with its appropriate arguments:

    Contributing

    🤝 There are several ways you can help in the development of DocBox!

    • 🔧

    • 🐛 Submit a bug or feature request to our

    • ✅

    🔧 Send a Pull Request
    • Fork DocBox or the DocBox documentation repo

    • Clone the repository fork to your machine - git clone [email protected]:ME/DocBox.git

    • Create a feature/ or patch/ branch: git checkout -b patch/syntax-error-in-html-output

    • Make your changes, commit as normal, and use git push to sync your commits to Github.

    • Please target all PRs at the development branch.

    ✅ Testing DocBox

    DocBox has a suite of Testbox specs validating that it works as expected. New features and bug fix PRs should (ideally) contain accompanying tests. Here's how to do that via CommandBox:

    1. After cloning the repo, run box install to install development dependencies

    2. Run box start to boot a test server

    3. Run box testbox run to run the suite of DocBox tests.

    4. Edit test specs in tests/specs as necessary, and run box testbox run again to validate tests pass.

    Send a pull request
    Jira issue tracker
    Write a test
    docbox = new DocBox();
    docbox.addStrategy( "JSON",
      {
          projectTitle = "DocBox API",
          outputDir = expandPath( "/resources/tmp" )
      } );
    docbox.generate(
        source  = "#expandPath( '/docbox' )",
        mapping = "coldbox",
        excludes = "tests"
    );

    HTML Output

    Generate browsable HTML documentation for your application CFCs

    🌐 The HTML API Strategy is used to create CFC documentation based on Javadoc. DocBox does not fully support all the Javadoc syntax, but hopefully it will soon.

    🎨 Modern Themes (New in 5.0)

    DocBox 5.0 introduces a completely redesigned HTML output with two professional themes:

    ⚡ Default Theme - Modern SPA

    The default theme features:

    • Alpine.js-based SPA - Client-side routing and dynamic filtering

    • 🌓 Dark Mode Support - Toggle between light and dark themes with persistence

    • 🔍 Real-time Search - Live method filtering with keyboard navigation (Enter/Shift+Enter)

    • 🎨 Modern UI - Bootstrap 5, purple gradient accents, emoji indicators

    📚 Frames Theme - Traditional Layout

    The frames theme provides:

    • Frameset-based Layout - Classic three-panel documentation view

    • Bootstrap 5 Styling - Modern component design

    • Package Navigation - Left sidebar with hierarchical tree

    • Dark Mode Support - Consistent theming across all panels

    🚀 Instantiate DocBox

    Begin by creating an instance of DocBox:

    ⚙️ Properties

    The following are the properties for this strategy:

    • projectTitle : The HTML title used in the documentation

    • outputDir : The output directory absolute path

    • theme : (Optional) Theme name - "default" or "frames"

    Just pass them in the docbox.addStrategy() call:

    🖄️ Using the Frames Theme

    To use the traditional frameset layout:

    📝 Generate Documentation

    Now that you have an instance of DocBox configured with your strategy and its properties, just execute the generate() method with its appropriate arguments:

    Installation

    Just use CommandBox! No, really.

    🦤 BoxLang Module Installation (Recommended for CLI)

    DocBox 5.0+ can be installed as a native BoxLang core module, providing access to the powerful CLI tool.

    CommandBox Web Runtimes

    📱 Responsive Design - Mobile-friendly layouts

  • 📑 Method Tabs - Filter by All/Public/Private/Static/Abstract

  • ✨ Smooth Scrolling - Enhanced navigation experience

  • Traditional UX - Familiar navigation pattern

    (defaults to
    "default"
    )
    BoxLang OS Runtime

    Once installed, you can use the boxlang module:docbox CLI command to generate documentation. See the BoxLang CLI Tool page for complete usage details and examples.

    Using DocBox in a Standalone Application

    Installing and using DocBox consists of three main steps:

    Download

    For best results, use CommandBox to run box install docbox --saveDev in your app root.

    Alternatively, you can download the DocBox source code and drop it into a docbox folder in your application.

    Mapping

    If DocBox is not installed in the root of your application, you will need to create a docbox mapping that points to the DocBox source code location:

    In addition to the Docbox mapping, you will need a Coldfusion server mapping for each source code location. For example, documenting a component with implements="cbsecurity.interfaces.IAuthService" will require a mapping of cbsecurity to the installedcbsecurity source code so DocBox can find the referenced interface.

    Using DocBox

    The final step to get DocBox running is to write a CFML script that initializes, configures, and runs DocBox against your application code.

    See Configuration for more details.

    Using DocBox from the Command Line

    We offer multiple ways to use DocBox from the command line:

    BoxLang CLI Module (New in 5.0)

    DocBox now includes a native BoxLang CLI module for generating documentation:

    CommandBox Module

    We also have a CommandBox module called DocBox Commands, which enables generating documentation from the CLI.

    1. Run box install commandbox-docbox to install the docbox command namespace

    2. Run docbox help to get a list of commands

    3. Run docbox generate help to show help for the docbox generate command

    Please see the DocBox Commands README for more info.

    docbox = new DocBox();
    docbox = new DocBox();
    docbox.addStrategy( "HTML", {
        projectTitle : "My Docs",
        outputDir    : expandPath( "/mydocs" ),
        theme        : "default"  // or "frames"
    } );
    docbox = new DocBox();
    docbox.addStrategy( "HTML", {
        projectTitle : "My API Docs",
        outputDir    : expandPath( "/mydocs" ),
        theme        : "frames"
    } );
    docbox.generate(
        source  = "#expandPath( '/docbox' )",
        mapping = "coldbox",
        excludes = "tests"
    );
    box install bx-docbox
    install-bx-module bx-docbox
    this.mappings[ "docbox" ] = expandPath( "./libraries/doctorBox" );
    # Basic usage
    boxlang module:docbox --source=/path/to/code --mapping=myapp --output-dir=/docs
    
    # With project title and excludes
    boxlang module:docbox --source=/src --mapping=myapp \
                           --excludes="(tests|build)" \
                           --output-dir=/docs \
                           --project-title="My API"
    
    # Multiple source mappings
    boxlang module:docbox --mappings:v1=/src/v1/models \
                           --mappings:v2=/src/v2/models \
                           --output-dir=/docs
    
    # Using frames theme
    boxlang module:docbox --source=/src --mapping=app \
                           --output-dir=/docs \
                           --theme=frames
    
    # Show help
    boxlang module:docbox --help
    
    # Show version
    boxlang module:docbox --version

    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

    • 📋 - Machine-readable JSON format

    • 📐 - XMI/UML diagram generation

    Each format is configured by its alias name, such as "JSON", "HTML", or "XMI".

    ⚙️ Basic Configuration

    🎯 Single Strategy

    🔄 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

    Frames Theme:

    • 📱 Traditional three-panel frameset

    • 🗂️ Left sidebar navigation

    • 🎨 Bootstrap 5 styling

    • 🌓 Dark mode support

    🔧 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)

    📁 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:

    💜 Modern purple gradient design
  • 🎯 Bootstrap 5 components

  • 📚 Classic documentation UX
    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
    JSON
    UML
    var docbox = new docbox.DocBox();
    docbox.addStrategy( "UML", { outputFile : "./tmp/docs/app-diagram.uml" })
    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)"
        );
    new docbox.DocBox()
        .addStrategy( "HTML", {
            projectTitle : "My Docs",
            outputDir    : expandPath( '/docs/html' ),
            theme        : "default"
        } )
        .addStrategy( "JSON", {
            projectTitle : "My Docs",
            outputDir    : expandPath( '/docs/json' )
        } )
        .addStrategy( "XMI", {
            outputFile : expandPath( '/docs/diagram.uml' )
        } )
        .generate(
            source   = expandPath( "/app" ),
            mapping  = "app",
            excludes = "(tests|build)"
        );
    // Use the modern SPA theme (default)
    docbox.addStrategy( "HTML", {
        projectTitle : "My API",
        outputDir    : expandPath( './docs' ),
        theme        : "default"
    } );
    
    // Use the traditional frames theme
    docbox.addStrategy( "HTML", {
        projectTitle : "My API",
        outputDir    : expandPath( './docs' ),
        theme        : "frames"
    } );
    docbox.generate(
        source   = expandPath( '/myapp' ),
        mapping  = 'myapp',
        excludes = '(tests|build)'
    );
    docbox.generate(
        source = [
            { dir: expandPath( '/app/models' ), mapping: 'app.models' },
            { dir: expandPath( '/app/handlers' ), mapping: 'app.handlers' },
            { dir: expandPath( '/plugins' ), mapping: 'plugins' }
        ],
        excludes = '(tests|specs)'
    );
    # Basic usage
    boxlang module:docbox --source=/path/to/code \
                           --mapping=myapp \
                           --output-dir=/docs
    
    # With options
    boxlang module:docbox --source=/app \
                           --mapping=myapp \
                           --output-dir=/docs \
                           --project-title="My API" \
                           --theme=frames \
                           --excludes="(tests|build)"
    
    # Multiple sources
    boxlang module:docbox --mappings:models=/app/models \
                           --mappings:handlers=/app/handlers \
                           --output-dir=/docs
    variables.docbox = new docbox.DocBox(
        strategy   = "docbox.strategy.uml2tools.XMIStrategy",
        properties = {
            projectTitle : "DocBox Tests",
            outputFile   : variables.testOutputFile
        }
    );

    What's New With 4.1.0

    Added

    • Adobe 2023 Testing and Support

    • New Github Actions

    • New supporting files

    • New build/Docs.cfc task for building the documentation using itself, before we where getting away with it because there was a previous DocBox version. Now we need to build the docs with the current version of DocBox.

    Fixed

    • Build Versions and changelog

    • Removal of box.zip in root from old scripts

    JSON Schema

    Understanding the output format of the DocBox JSON strategy

    The JSON strategy outputs three types of files:

    • Overview Summary

    • Package Summary

    • Class Documentation

    Overview Summary

    DocBox's JSON strategy outputs a single overview-summary.json file in the root of the configured outputDir directory that documents all packages (component directories) and classes in the configured source.

    This overview-summary.json file will match the following schema:

    See an example at

    Package Summary

    DocBox's JSON strategy outputs a package-summary.json file for every directory found in the configured source directory that contains at least one ColdFusion component.

    • source/autos/autoBuilder.cfc will generate a docs/source/autos/package-summary.json

    This package-summary.json file will match the following schema:

    See an example at

    Class Documentation

    DocBox's JSON strategy outputs a single class.json file for every .cfc component found in the configured source directory.

    The name of the file will reflect the component name, and the location will match the source directory hierarchy:

    • source/app/autos/autoBuilder.cfc becomes docs/source/app/autos/autoBuilder.json

    • source/main.cfc becomes docs/source/main.json

    Each component documentation file will match the following schema:

    See an example at

    BoxLang CLI Tool

    🦤 DocBox 5.0+ includes a native BoxLang module with a powerful CLI tool for generating documentation directly from the command line.

    📦 Installation

    DocBox can be installed as a BoxLang core module using the bx-docbox slug:

    CommandBox Web Runtimes

    BoxLang OS Runtime

    Once installed, the boxlang module:docbox command becomes available for generating documentation.


    🎯 Usage

    ⚙️ Required Options

    Option
    Short
    Description

    📂 Source Options

    Option
    Description

    ⚙️ Additional Options

    Option
    Short
    Description

    💡 Examples

    📌 Basic Usage

    Generate documentation for a single source directory:

    📌 With Project Title and Excludes

    📌 Short Form Output Directory

    📌 Multiple Source Mappings

    Document multiple source directories with different mappings:

    📌 Using Frames Theme

    Generate documentation with the traditional frameset layout:

    📌 JSON Array Format

    Specify multiple sources using JSON array notation:

    📌 Real-World Example: ColdBox Framework


    🔧 Command Output

    When you run the CLI tool, you'll see output like this:


    🆘 Getting Help

    Show Help

    This displays comprehensive usage information including:

    • Command syntax

    • All available options

    • Multiple examples

    • Links to documentation

    Show Version

    Displays:

    • DocBox version

    • Author information

    • Website URL


    ⚠️ Common Issues

    Missing Source Mappings

    Error:

    Solution: Ensure you provide either:

    • --source and --mapping together

    • One or more --mappings:<name>=<path> options

    • JSON array via --source

    Missing Output Directory

    Error:

    Solution: Always specify where to generate documentation:

    Source Directory Not Found

    Warning:

    Solution: Verify the source path exists and is accessible. Use absolute paths or paths relative to your current working directory.


    🎨 Theme Selection

    DocBox 5.0+ includes two modern themes:

    Default Theme (Alpine.js SPA)

    Features:

    • ⚡ Alpine.js-based SPA

    • 🌓 Dark mode support

    • 🔍 Real-time search

    • 📑 Method tabs

    Frames Theme (Traditional)

    Features:

    • 🗂️ Traditional frameset layout

    • 📚 jstree navigation

    • 📱 Left sidebar for packages

    • 🎯 Bootstrap 5 styling


    🔗 Integration with Build Scripts

    CommandBox Task Runner

    Create a task.cfc to generate documentation:

    Run with: box task run

    CI/CD Pipeline

    Add to your GitHub Actions, GitLab CI, or other CI/CD pipeline:


    📚 Next Steps

    • - Learn about strategy properties and advanced configuration

    • - Explore HTML theme features

    • - Write effective JavaDoc comments

    JSONSchemaValidator.net
    JSONSchemaValidator.net
    JSONSchemaValidator.net

    --theme=<name>

    🎨 Theme name (default or frames)

    --strategy=<class>

    Documentation strategy class (default: docbox.strategy.api.HTMLAPIStrategy)

    💜 Modern purple design

    --output-dir=<path>

    -o=<path>

    📁 Output directory for generated docs

    --source=<path>

    Source directory to document

    --mapping=<name>

    Base mapping for the source folder

    --mappings:<name>=<path>

    Define multiple source mappings

    --help

    -h

    Show help information

    --version

    -v

    Show version information

    --excludes=<regex>

    Regex pattern to exclude files/folders

    --project-title=<title>

    📖 Project title for documentation

    Configuration Options
    HTML Output
    Annotating Your Code
    {
        "$id": "point-to-public-json-schema.json",
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "Package documentation index",
        "description": "This class index links to each generated class documentation JSON file.",
        "required": [],
        "type": "object",
        "properties": {
            "title": {
                "type": "string"
            },
            "classes": {
                "type": "array",
                "items": {
                    "type": "object",
                    "properties": {
                        "name": {
                            "type": "string"
                        },
                        "path": {
                            "type": "string"
                        }
                    }
                }
            },
            "packages": {
                "type": "object",
                "items": {
                    "type": "object",
                    "properties": {
                        "name": {
                            "type": "string"
                        },
                        "path": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    }
    {
        "$id": "point-to-public-json-schema.json",
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "Package documentation index",
        "description": "Index file documenting each coldfusion component inside a package level - i.e. per directory.",
        "required": [],
        "type": "object",
        "properties": {
            "title": {
                "type": "string"
            },
            "classes": {
                "type": "array",
                "items": {
                    "type": "object",
                    "properties": {
                        "name": {
                            "type": "string"
                        },
                        "path": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    }
    {
        "$id": "point-to-public-json-schema.json",
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "Class documentation",
        "description": "Documents a single class in a ColdFusion package.",
        "required": [],
        "definitions": {
            "function" : {
                "type" : "object",
                "properties": {
                    "name" : { "type" : "string" },
                    "hint" : { "type" : "string" },
                    "description" : { "type" : "string" },
                    "access" : { "type" : "string" },
                    "parameters" : {
                        "type" : "array",
                        "items": { "$ref" : "#/definitions/parameter" }
                    },
                    "returnType" : { "type" : "string" },
                    "returnFormat" : { "type" : "string" },
                    "position" : {
                        "type" : "object",
                        "properties" : {
                            "start" : { "type" : "integer" },
                            "end" : { "type" : "integer" }
                        }
                    }
                }
            },
            "parameter" : {
                "type" : "object",
                "properties": {
                    "type" : { "type" : "string" },
                    "name" : { "type" : "string" },
                    "required" : { "type" : "boolean" },
                    "default" : { "type" : "string" }
                }
            }
        },
        "type": "object",
        "properties": {
            "name" : { "type": "string" },
            "package" : { "type": "string" },
            "type" : { "type": "string" },
            "extends" : { "type" : "string" },
            "implements" : { "type" : "string" },
            "hint" : { "type" : "string" },
            "description" : { "type" : "string" },
            "properties" : {
                "description" : "Literally the component properties set via `property` or `cfproperty`.",
                "type" : "object",
                "properties": {
                    "type" : { "type" : "string" },
                    "name" : { "type" : "string" },
                    "access" : { "type" : "string" },
                    "hint" : { "type" : "string" },
                    "default" : { "type" : "string" },
                    "required" : { "type" : "boolean" }
                }
            },
            "constructor" : { "$ref": "#/definitions/function" },
            "functions" : {
                "type" : "array",
                "items" : { "$ref": "#/definitions/function" }
            }
        }
      }
    box install bx-docbox
    install-bx-module bx-docbox
    boxlang module:docbox [options]
    boxlang module:docbox --source=/src/models \
                           --mapping=models \
                           --output-dir=/docs
    boxlang module:docbox --source=/src \
                           --mapping=myapp \
                           --excludes="(tests|build)" \
                           --output-dir=/docs \
                           --project-title="My API"
    boxlang module:docbox --source=/src \
                           --mapping=app \
                           -o=/docs
    boxlang module:docbox --mappings:v1=/src/v1/models \
                           --mappings:v2=/src/v2/models \
                           --output-dir=/docs \
                           --project-title="API Docs"
    boxlang module:docbox --source=/src \
                           --mapping=app \
                           --output-dir=/docs \
                           --theme=frames
    boxlang module:docbox --source="[{'dir':'/src/models', 'mapping':'models'}, {'dir':'/src/services', 'mapping':'services'}]" \
                           --output-dir=/docs \
                           --project-title="My API"
    boxlang module:docbox --source=tests/resources/coldbox \
                           --mapping=coldbox \
                           --excludes="(tests|build)" \
                           --output-dir=tests/apidocs \
                           --project-title="ColdBox Framework" \
                           --theme=default
    ═══════════════════════════════════════════════════════════════════
      📚 DocBox Documentation Generator
    ═══════════════════════════════════════════════════════════════════
    
    📂 Source:  /Users/myapp/src/models
    🔗 Mapping: models
    📁 Output:  /Users/myapp/docs
    
    ⏳ Starting generation, please wait...
    
    🥊 Generation complete!
    Documentation available at: /Users/myapp/docs
    boxlang module:docbox --help
    boxlang module:docbox --version
    ❌ ERROR: No valid source mappings found.
    ❌ ERROR: --output-dir is required
    boxlang module:docbox --source=/src --mapping=app --output-dir=/docs
    ⚠️  Warning: '/path/to/source' does not exist.
    boxlang module:docbox --source=/src --mapping=app \
                           --output-dir=/docs \
                           --theme=default
    boxlang module:docbox --source=/src --mapping=app \
                           --output-dir=/docs \
                           --theme=frames
    component {
        function run() {
            command( "boxlang" )
                .params(
                    "module:docbox",
                    "--source=#getCWD()#/models",
                    "--mapping=models",
                    "--output-dir=#getCWD()#/docs",
                    "--project-title=My Project",
                    "--theme=default"
                )
                .run();
        }
    }
    - name: Generate API Documentation
      run: |
        boxlang module:docbox \
          --source=./src \
          --mapping=myapp \
          --output-dir=./build/docs \
          --project-title="My Application" \
          --theme=default

    UML Output

    Generate an XML file for graphing your application via Eclipse UML2Tools

    📐 Generate an XML file for graphing your application via Eclipse UML2Tools

    UML2 Tools hasn't been developed for Eclipse since 2008. This strategy is now more for reference than anything else.

    This is a documentation strategy that ultimately lets you generate UML diagrams from the CFCs that you have written. That being said, it does not actually generate diagrams.

    What this template startegy does is generate the XML file the Eclipse UML2 Tools that stores the information about your domain - the classes, the associations, the inheritence hierarchy, etc. From there it is very easy with UML2 Tools to generate UML diagrams like Class Diagrams, Sequence Diagrams, etc.

    To get started, you need to download and install the Eclipe plugin UML2 Tools in your Eclipse install.

    1. Go to:

    2. We are actually going to use the 0.9.1 Integration Builds plugin, simply because it is more stable, and has several key bug fixes.

    3. Download the All-In-One Update Site and save the .zip file

    Once that process is complete, the Eclipse UML2 Tools plugin should now be installed and working.

    To get DocBox to generate the .uml file that UML2Tools needs, we use the UMLstrategy. For example:

    This will generate the .uml (in this case docbox.uml) file which we can then use.

    To view and edit the UML diagrams from here:

    1. Browse to the .uml file that you generated in the Navigator Pane

    2. Right click on the .uml file

    3. Select Initialise Class Diagram

    4. Select the root package that you wish to model

    You will now be presented with a UML Class diagram of your CFC model.

    There are other types of UML2 diagrams that can be created. Have a look at the UML2 Tools documentation for more options.

    Strategy Assumptions

    There are some assumptions that are made by this strategy, when converting from CFCs to UML diagrams, as some meta data on CFCS are not provided and/or cannot be specified.

    • A property/field is determined for a class when a get and set function exist with the same name (or set and is for boolean values) and the argument type of the set function matches the return type of the get/is function.

    • The scope for the property/field is selected by highest level of exposure between the get and set functions. I.e. if getFoo() is public, and setFoo() is private, then the property foo is marked as public.

    In Eclipse, go to
    Help > Install New Software
  • Click Add

  • Enter the name UML2 Tools in Name

  • Click Archive and select the .zip file you downloaded.

    1 . Click OK, and continue through the installation process

  • Click OK

    All associations are of type aggregation, rather than composition
    http://www.eclipse.org/modeling/mdt/downloads/?showAll=1&hlbuild=I200907241018&project=uml2tools
    docBox = new DocBox();
    docBox.addStrategy( "UML", { projectFile = expandPath( "./uml/docbox.uml" ) });
    docbox.generate( expandPath("/docbox"), "docbox" );

    What's New With 5.0.0

    🎉 Major Release - BoxLang Support & Modern UI Overhaul

    BREAKING CHANGES

    • Minimum CFML engine requirements updated:

      • Lucee 5.x minimum (dropped Lucee 4.x)

      • Adobe ColdFusion 2018+ (dropped ACF 2016, 2018)

    • HTML output now uses Bootstrap 5 (previously Bootstrap 3)

    • Default theme structure reorganized with new Alpine.js-based SPA architecture

    NEW - BoxLang Support 🚀

    • Full BoxLang 1.0+ Runtime Support - DocBox now runs natively on BoxLang

    • BoxLang CLI Module - New boxlang module:docbox command for generating docs from BoxLang CLI

      • boxlang module:docbox --source=/path --mapping=app --output-dir=/docs

    NEW - Modern HTML Theme System 🎨

    • Two Professional Themes:

      • Default Theme - Modern Alpine.js SPA with client-side routing and dynamic filtering

      • Frames Theme - Traditional frameset-based layout with Bootstrap 5

    • Theme Selection - Choose themes via

    NEW - Enhanced UI/UX Features 💎

    • Modern Color Scheme - Purple gradient accents (#5e72e4), softer colors, reduced blue overload

    • Visual Indicators - Emoji badges throughout:

      • 📚 Packages, 📁 Folders, 🔌 Interfaces, 📦 Classes

      • 🟢 Public, 🔒 Private, ⚡ Static, 📝 Abstract

    NEW - Complete Relationship Documentation 📊

    • All Known Implementing Classes - Interfaces now show all classes that implement them

    • All Known Subclasses/Subinterfaces - Display complete inheritance hierarchy

    • Fixed Inheritance Queries - Properly handles both current class and ancestor interfaces

    • Improved Package Highlighting - Subtle left border instead of full background

    NEW - Developer Experience Improvements 🛠️

    • Enhanced JavaDoc Support - Comprehensive documentation with <br> tags for BoxLang compatibility

    • 50+ Updated Code Examples - All strategy files updated with proper line breaks

    • Improved Error Messages - Better validation and user-friendly CLI output

    NEW - Strategy Enhancements 📝

    • CommandBox Strategy - Enhanced CLI command documentation with namespace support

    • JSON Strategy - Machine-readable JSON with hierarchical package structure

    • XMI/UML Strategy - Enhanced property inference and generic type support

    • Abstract Template Strategy - Improved helper methods for all strategies

    IMPROVED

    • Build System - Updated build process with BoxLang support

    • Testing - Multi-engine testing (Lucee 5/6, Adobe 2023/2025, BoxLang 1.0/BE)

    • Documentation - Comprehensive updates for all new features

    • Code Formatting - Consistent CFFormat rules across entire codebase

    FIXED

    • Metadata Format Handling - getImplements() now properly handles both array and struct formats

    • Interface Implementation Display - Fixed empty queries for implementing classes

    • Package Navigation - Improved CSS styling for better UX

    TECHNICAL DETAILS

    • Bootstrap 5.3.2 - Modern component syntax and data-bs-* attributes

    • Bootstrap Icons 1.11.2 - Comprehensive icon set for UI elements

    • Alpine.js - Lightweight reactive framework for SPA theme

    • CSS Architecture - CSS custom properties for theming with light/dark mode

    MIGRATION NOTES

    From 4.x to 5.0

    1. Minimum Requirements: Ensure you're running Lucee 5+, Adobe 2018+, or BoxLang 1.0+

    2. HTML Output: The default theme now uses Bootstrap 5. If you have custom CSS, review for compatibility

    3. Theme Selection: Explicitly set theme="frames" if you prefer the traditional frameset layout

    Updating HTML Customizations

    If you extended the HTML strategy:

    • Update Bootstrap 3 classes to Bootstrap 5 equivalents

    • Review custom CSS for CSS custom property compatibility

    • Test dark mode if you have custom themes

    UPGRADE INSTRUCTIONS

    COMMUNITY

    • GitHub Issues: https://github.com/Ortus-Solutions/DocBox/issues

    • Documentation: https://docbox.ortusbooks.com

    • Community Forum: https://community.ortussolutions.com

    Support for multiple source mappings

  • JSON array format support for complex project structures

  • Built-in help system with --help and --version flags

  • Dual Format Metadata Handling - Automatically detects and handles both BoxLang array format and CFML struct format for implements metadata

  • ModuleConfig.bx - Native BoxLang module configuration for seamless integration

  • theme
    property:
  • Dark Mode Support - Full dark/light theme toggle with localStorage persistence

  • Responsive Design - Mobile-friendly layouts with proper breakpoints

  • Real-time Method Search - Live filtering with keyboard navigation

    • Search methods by name or signature

    • Navigate results with Enter/Shift+Enter

    • Visual highlighting and auto-scroll

    • Clear with Escape key

  • Method Tabs - Tabbed interface for filtering methods (All/Public/Private/Static/Abstract)

  • Bootstrap Tooltips - Contextual help on visibility badges and deprecated methods

  • Smooth Scrolling - Enhanced navigation with smooth scroll behavior

  • Auto-expanding Navigation - jstree automatically expands first 2 levels for better UX

  • Modern JavaScript
    - ES6+ features with proper spacing conventions
  • CSS Custom Properties - Comprehensive theming system with CSS variables

  • Performance - Optimized query operations and template rendering

    Line Break Handling
    - Workaround for BoxLang metadata line break stripping
  • Inheritance Detection - Properly checks current class before ancestors

  • JavaScript Conventions - Proper spacing in all control structures and function calls

    BoxLang Users
    : Use the new
    boxlang module:docbox
    CLI command for native BoxLang integration
    # CommandBox users
    box update docbox
    
    # BoxLang users
    boxlang install docbox
    
    # Verify installation
    box package show version
    new docbox.DocBox()
        .addStrategy( "HTML", {
            outputDir : "/docs",
            theme     : "default" // or "frames"
        } )

    Annotating Your Code

    📝 DocBox reads your CFCs and creates documentation according to your objects, inheritance, implementations, functions, arguments, comments and metadata. We try to follow the JavaDoc style of annotations even though it is not 100% compatible yet.

    💬 DocBox Comments

    DocBox comments may be placed above any CFC, property, function, or argument which we want to document.

    These comments are commonly made up of two sections:

    • The description of what we're commenting on

    • The standalone block tags (marked with the @ symbol) which describe specific meta-data

    • Also all core engine attributes to components, properties, functions and arguments will be documented automatically for you.

    For the full JavaDoc spec click here:

    📚 DocBox at the CFC Level

    This is a simple component declaration where we define the hint for the component and add block tags like @author . All attributes to the component will be documented for you as name-value pairs on the final output.

    🎯 DocBox at the Property Level```java

    /**

    • Hero is the main entity we'll be using to create awesome stuff

    • @author Captain America

    */ component name="SuperHero" accessors="true" transient{

    }

    Functions can have a variety of block tags alongside the main description of the function. Also notice that each argument can also be documented via the @argName block tag.

    Argument Annotations

    Arguments can also have multiple annotations for documentation or semantic usage purposes.

    This is done by using a . period delimiter and then adding another block name or semantic name to use.

    Core Blocks

    Here are some of the core blocks that can be used in DocBox:

    Tag
    Explanation

    Custom DocBox Blocks

    Here are some blocks that ONLY DocBox can read:

    Tag
    Explanation

    Examples

    All of the ortus repos have all their CFC documented. Please check out some of them here:

    /**
     * This is a Javadoc compliant comment for DocBox
     */

    @{anything}

    Anything you like. That's right, DocBox will document any block pairs for you in a simple output manner.

    @see

    Not implemented yet

    @author

    Provides information about the author, typically the author’s name, e-mail address, website information, and so on.

    @version

    Indicates the version number.

    @since

    Used to indicate the version with which this class, field, or method was added.

    @return

    Provides a description of a method’s return value.

    @throws

    Indicates exceptions that are thrown by a method or constructor. You can add multiple @throws in a function declaration.

    @deprecated

    Indicates that the class, field, or method is deprecated and shouldn’t be used.

    @doc_abstract

    Used on components to demarcate them as abstract components. Please note that you can also use the abstract attribute that ColdFusion 2016+ introduced.

    @doc_generic

    This is an annotation that can be placed on either a function or argument declaration. This annotation is used to specify what generic type is being used, which is particularly useful when a return or argument type is an array or a struct or any. The value can be a single type or a list.

    https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html
    https://github.com/Ortus-Solutions/DocBox
    https://github.com/coldbox/coldbox-platform
    https://github.com/Ortus-Solutions/commandbox
    https://github.com/Ortus-Solutions/ContentBox
    /**
    * Hero is the main entity we'll be using to create awesome stuff
    *
    * @author Captain America
    *
    */
    component name="SuperHero" accessors="true" transient{
        // properties and functions
    }
    /**
     * A collection of aliases this superhero is known as
     */
    property name="alias" type="array";
    
    /**
     * Internal alias name
     * @deprecated true
     */
    property name="_alias" type="array";
    
    Properties also have comments and you can add `@` blocks as well.
    
    ## DocBox at the Function Level
    
    ```java
    /**
     * get Java FileInputStream for resource bundle
     *
     * @rbFilePath path + filename for resource, including locale + .properties
     *
     * @return java.io.FileInputStream
     * @throws ResourceBundle.InvalidBundlePath
     */
    public function getResourceFileInputStream( required string rbFilePath ){
    }
    cBox at the Function Level
    /**
     * get Java FileInputStream for resource bundle
     *
     * @rbFilePath path + filename for resource, including locale + .properties
     * @rbFilePath.deprecated true
     *
     * @return java.io.FileInputStream
     * @throws ResourceBundle.InvalidBundlePath
     */
    public function getResourceFileInputStream( required string rbFilePath ){
    }
    /**
     * @doc_abstract true
     */
    component doc_abstract="true" { ... }
    component doc_abstract { ... }
    
    
    /**
     * Get foo array
     *
     * @doc_generic com.Foo
     */
    private array function getFooArray(){
      return variables.foo;
    }
    
    // Inline
    private array function getFooArray() doc_generic="com.Foo"{
      return variables.foo;
    }
    
    /**
     * Set my struct
     *
     * @myStruct.doc_generic uuid,string
     */
    private void function setMyStruct( required struct myStruct ){
      instance.myStruct = arguments.myStruct;
    }
    
    // Inline
    private void function setMyStruct(
      required struct myStruct doc_generic="uuid,string"
    ){
      instance.myStruct = arguments.myStruct;
    }