Command Line Tools
wheels docs generate
wheels docs generate
Section titled “wheels docs generate”Generates documentation for your Wheels application from code comments and annotations.
wheels docs generate [--output=<dir>] [--format=<format>] [--include=<components>] [--serve] [--verbose]Parameters
Section titled “Parameters”-
--output- (Optional) Output directory for docs. Default:docs/api -
--format- (Optional) Documentation format:html,json,markdown. Default:html -
--include- (Optional) Components to include:models,controllers,views,services. Default:models,controllers -
--serve- (Optional) Start local server after generation -
--verbose- (Optional) Verbose output
Description
Section titled “Description”The docs generate command automatically creates comprehensive documentation from your Wheels application by parsing:
- JavaDoc-style comments in CFCs
- Model relationships and validations
- Controller actions and routes
- Configuration files
- Database schema
- API endpoints
Examples
Section titled “Examples”Generate complete documentation
Section titled “Generate complete documentation”wheels docs generateGenerate markdown docs
Section titled “Generate markdown docs”wheels docs generate --format=markdownGenerate and serve immediately
Section titled “Generate and serve immediately”wheels docs generate --serveGenerate specific components with verbose output
Section titled “Generate specific components with verbose output”wheels docs generate --include=models,controllers,services --verboseCustom output directory
Section titled “Custom output directory”wheels docs generate --output=public/api-docs --format=htmlDocumentation Sources
Section titled “Documentation Sources”Model Documentation
Section titled “Model Documentation”/** * User model for authentication and authorization * * @author John Doe * @since 1.0.0 */component extends="Model" {
/** * Initialize user relationships and validations * @hint Sets up the user model configuration */ function config() { // Relationships hasMany("orders"); belongsTo("role");
// Validations validatesPresenceOf("email,firstName,lastName"); validatesUniquenessOf("email"); }
/** * Find active users with recent activity * * @param days Number of days to look back * @return query Active users */ public query function findActive(numeric days=30) { return findAll( where="lastLoginAt >= :date", params={date: dateAdd("d", -arguments.days, now())} ); }}Controller Documentation
Section titled “Controller Documentation”/** * Handles user management operations * * @displayname User Controller * @namespace /users */component extends="Controller" {
/** * Display paginated list of users * * @hint GET /users * @access public * @return void */ function index() { param name="params.page" default="1"; users = model("user").findAll( page=params.page, perPage=20, order="createdAt DESC" ); }}Generated Output
Section titled “Generated Output”HTML Format
Section titled “HTML Format”/docs/api/├── index.html├── models/│ ├── model.html/├── controllers/│ ├── controller.html├── views/| └── view.html├── services/ └── view.htmlDocumentation includes:
Section titled “Documentation includes:”- Overview: Application structure and architecture
- Models: Properties, methods, relationships, validations
- Controllers: Actions, filters, routes
- API Reference: Endpoints, parameters, responses
- Database Schema: Tables, columns, indexes
- Configuration: Settings and environment variables
Output Example
Section titled “Output Example”================================================== Documentation Generator==================================================
Generating documentation...
create directory public/api-docs
Scanning Source Files--------------------------------------------------[SUCCESS]: Found 1 models[SUCCESS]: Found 4 controllers
Writing documentation...[SUCCESS]: HTML files generated
[SUCCESS]: Documentation generated successfully!
Summary--------------------------------------------------Models: 1 filesControllers: 4 filesTotal Components: 5 documented
[INFO]: Output directory: C:\Users\Hp\cli_testingapp\db_app\public\api-docs