Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Dropped support for Adobe 2016. Adobe doesn't support ACF 16 anymore, so neither do we.
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
Fixes support for Adobe 2018. (Mainly in the CommandBox strategy.)
DocBox is a JavaDoc-style documentation generator for your ColdFusion (CFML) codebase
DocBox reads component metadata and structured comments and outputs documentation in an HTML, JSON, or UML (diagram) format.
Lucee 5+
Adobe ColdFusion 2018+
DocBox is maintained under the Semantic Versioning 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
Apache 2 License: http://www.apache.org/licenses/LICENSE-2.0
Community: https://community.ortussolutions.com/
DocBox is professional open source software backed by Ortus Solutions, Corp offering services like:
Custom Development
Professional Support & Mentoring
Training
Server Tuning
Security Hardening
Code Reviews
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
Just use CommandBox! No, really.
Installing and using DocBox consists of three main steps:
Alternatively, you can download the DocBox source code and drop it into a docbox
folder in your application.
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.
The final step to get DocBox running is to write a CFML script that initializes, configures, and runs DocBox against your application code.
Run box install commandbox-docbox
to install the docbox
command namespace
Run docbox help
to get a list of commands
Run docbox generate help
to show help for the docbox generate
command
For best results, use to run box install docbox --saveDev
in your app root.
See for more details.
We also have a CommandBox module called which enables generating documentation from the CLI.
Please see the for more info.
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.
This major bump was to deprecate some CFML engines
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.
The migration from ColdDoc into DocBox.
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 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: https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html
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.
Properties also have comments and you can add @
blocks as well.
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.
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.
Here are some of the core blocks that can be used in DocBox:
@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.
@{anything}
Anything you like. That's right, DocBox will document any block pairs for you in a simple output manner.
@see
Not implemented yet
Here are some blocks that ONLY DocBox can read:
@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.
All of the ortus repos have all their CFC documented. Please check out some of them here:
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.
Begin by creating an instance of DocBox
:
The following are the properties for this strategy:
projectTitle
: The HTML title used in the documentation
outputDir
: The output directory absolute path
Just pass them in the docbox.addStrategy()
call:
Now that you have an instance of DocBox configured with your strategy and its properties, just execute the generate()
method with its appropriate arguments:
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.
Build Versions and changelog
Removal of box.zip
in root from old scripts
DocBox offers several built-in output formats as well as enabling you to create your own:
Each format is configured by its alias name, such as "JSON"
or "HTML"
.
For backwards compatibility, specifying the full class path is still supported, as is specifying a single strategy when initializing DocBox:
You can call the .addStrategy()
method multiple times to specify multiple output formats:
Generate JSON output for easy documentation imports into other documentation tools and platforms.
Begin by creating an instance of DocBox
:
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:
Now that you have an instance of DocBox configured with your strategy and its properties, just execute the generate()
method with its appropriate arguments:
There are several ways you can help in the development of DocBox!
Submit a bug or feature request to our Jira issue tracker
Fork DocBox or the DocBox documentation repo
Clone the repository fork to your machine - git clone git@github.com: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.
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:
After cloning the repo, run box install
to install development dependencies
Run box start
to boot a test server
Run box testbox run
to run the suite of DocBox tests.
Edit test specs in tests/specs
as necessary, and run box testbox run
again to validate tests pass.
In addition to the mainstream output formats, you can extend DocBox's AbstractTemplateStrategy
component to generate your own custom-formatted documentation:
Understanding the output format of the DocBox JSON strategy
The JSON strategy outputs three types of files:
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 JSONSchemaValidator.net
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 JSONSchemaValidator.net
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 JSONSchemaValidator.net
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.
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.
Download the All-In-One Update Site and save the .zip file
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
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 UML
strategy. 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:
Browse to the .uml file that you generated in the Navigator Pane
Right click on the .uml file
Select Initialise Class Diagram
Select the root package that you wish to model
Click OK
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.
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.
All associations are of type aggregation, rather than composition