|
This plugin provides functionality to obtain information about CFCs via introspection and generate cool documentation about them.
Set the rendering template to use instead of the default ColdBox one.
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| RenderingTemplate | string | Yes | --- |
getPlugin("CFCViewer").setRenderingTemplate("/includes/MyDocs.cfm");
Render the content
// Choose where you want the docs to be rendered: <div id="content"> #getPlugin("CFCViewer").renderit()# </div>
Get the dirpath of where the cfc's reside. This is expanded.
returns an array with the names of all components within the current directory
// mostly used when building your own rendering templates <cfloop array="#getPlugin("CFCViewer").getaCFC()#"> </cfloop>
Use this method to initialize for documentation. You must persist it in your request so you can do renderings and interact with the object.
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| dirpath | string | Yes | --- | The directory path to which is the root of what you want the cfcviewer to report on. This must be a valid instantiation path: ex: /coldbox/system |
| accessTypesFilter | string | No | Use this argument to only display methods with the access types given. If empty, displays all methods (public, private, remote, package). | |
| dirLink | string | No | --- | If you pass this. it will create a linkable directory or package structure according to the link provided and append an internal package variable. |
| jsLink | string | No | --- | If you pass this, it will create a linkable package according to the js provided. Also, place a @package@ on your link, so it can correctly identify where to place the url parameter for the package choosen |
| RenderingTemplate | string | No | --- | Override the rendering template with yours |
| LinkBaseURL | string | No | --- | The base url to use for anchors |
// setup the documentation viewer = getPlugin("CFCViewer").setup(dirPath="/coldbox/system/plugins",linkBaseURL=getSetting('sesBaseURL')); // setup the documentation viewer = getPlugin("CFCViewer").setup(dirPath="/coldbox/system/plugins",accessTypeFilter="public,remote"); // setup the documentation via JS links viewer = getPlugin("CFCViewer").setup(dirPath="/coldbox/system/plugins",jsLink="changeDocs('@package@')");
Set the stylesheet to use when rendering the documentation
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| styleSheet | string | Yes | --- |
viewer.setStyleSheet('includes/docs/mydocs.css');
Get aPacks
// get the packages array that is found in the current documentation directory
packages = viewer.getaPacks();