Skip to content

CommandBox command for generating API docs from the command line.

Notifications You must be signed in to change notification settings

Ortus-Solutions/commandbox-docbox

Repository files navigation

📦 CommandBox DocBox Commands

Build Status License

A CommandBox module for generating API documentation from CFML/BoxLang codebases using DocBox. Generate beautiful JavaDoc-style reference documentation directly from the command line!

🚀 Features

  • ✅ Generate API documentation from CFML/BoxLang source code
  • ✅ Support for multiple source directories and mappings
  • ✅ Multiple output strategies (HTML, JSON, XMI)
  • ✅ Customizable project titles and output locations
  • ✅ Regex-based exclusion patterns
  • ✅ JSON array format for complex mapping scenarios

📋 System Requirements

  • CommandBox 2.5+

📥 Installation

Install the commands via CommandBox:

box install commandbox-docbox

💡 Usage

Basic Usage

Generate documentation with a single source directory:

docbox generate source=/path/to/coldbox \
	mapping=coldbox \
	excludes=tests \
	strategy-outputDir=/output/path \
	strategy-projectTitle="My Docs"

Multiple Mappings (Dynamic Parameters)

Generate documentation for multiple source directories using dynamic parameters:

docbox generate mappings:v1.models=/path/to/modules_app/v1/models \
	mappings:v2.models=/path/to/modules_app/v2/models \
	strategy-outputDir=/output/path \
	strategy-projectTitle="My API v1 & v2"

Multiple Mappings (JSON Array)

For complex scenarios, use JSON array format:

docbox generate \
	source="[{'dir':'../src/modules_app/v1/models', 'mapping':'v1.models'}, {'dir':'../src/modules_app/v2/models', 'mapping':'v2.models'}]" \
	strategy-outputDir=docs \
	strategy-projectTitle="My API"

⚙️ Command Arguments

Argument Description
strategy The strategy class to use for generating docs. Default: docbox.strategy.api.HTMLAPIStrategy
source The directory containing the CFML/BoxLang source code
mapping The base mapping for the source folder
excludes A regex pattern to exclude files/folders from documentation
mappings:* Dynamic parameters defining source and mapping pairs (overrides source and mapping)
strategy-* Any strategy-specific options (e.g., strategy-outputDir, strategy-projectTitle)

Available Strategies

  • docbox.strategy.api.HTMLAPIStrategy - Generate HTML API documentation (default)
  • docbox.strategy.json.JSONAPIStrategy - Generate JSON API documentation
  • docbox.strategy.uml2tools.XMIStrategy - Generate XMI for UML tools

🛠️ Development

Build Scripts

# Format code
box run-script format

# Watch and auto-format on changes
box run-script format:watch

# Check formatting without changes
box run-script format:check

# Generate API docs
box run-script build:docs

# Full build (source + docs + checksums)
box run-script build:module

📖 Resources

📄 License

Apache License, Version 2.0 - See LICENSE


🙏 Credits & Contributions

Contributors

Support Ortus Solutions

This project is maintained by Ortus Solutions. Support our open source work!


THE DAILY BREAD

"I am the way, and the truth, and the life; no one comes to the Father, but by me (JESUS)" - John 14:6


Built with ❤️ by Ortus Solutions

About

CommandBox command for generating API docs from the command line.

Resources

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 6