ColdDuck – beautiful documentation for ColdFusion CFCs


I have been a consumer of the Sencha ExtJS documentation for a while now and wanted to be able to use JSDuck for my ColdFusion CFCs. But how? While I am a JSDuck novice I figured that trying to make JSDuck produce documentation directly from ColdFusion CFCs was likely to result in tears (mine!). So, after some thought, I came up with another strategy that users of other programming languages might want to consider.

My CF to JSDuck strategy

Mark Mandel’s ColdDoc can be extended to produce different kinds of output by utilising a “strategy” cfc. It comes with one that produces the JavaDoc style HTML format. Strategies utilise the CF ComponentMetaData. So, I made my own strategy that takes ColdFusion CFCs and makes a pseudo-app in JavaScript code that is annotated using JSDuck formatting. Of course it auto-documents functions etc and picks up the ‘hint’ attributes where it finds them and uses all that to produce the raw material for rich documentation. It also works with CF ORM CFCs (although this part could be made even richer than it is at present).

Video overview

Here is a really quick video to give an overview of what ColdDuck does:


The ColdDuck package includes the documentation. You can also view it here

Sample output

Here is the sample SuperBlog app documented with ColdDoc in JavaDoc format

Here is the sample SuperBlog app documented with ColdDuck in JSDuck format

A full implementation of JSDuck style documentation is here

Almost all of that JSDuck functionality is available for you to use for your ColdFusion projects. I say “almost” because there are a few JSDuck features that are JavaScript specific (eg view JS class source).


Get it at GitHub

I hope you find this useful and fun. Please leave your comments below.


7 thoughts on “ColdDuck – beautiful documentation for ColdFusion CFCs

  1. Just started using this with CF11, JSDuck 6.0.0beta, and ColdDoc 1.0. Everything was super easy to set up and get running! Seems to work, albeit with a few minor modifications – our code base has some CF arguments named the same as Javascript keywords so I mangled them when creating the pseudo project, and CF11 doesn’t allow using cfmodule with anything besides a cfm or cfc so I updated ColdDoc source code as well.

    Great project, thanks for doing this.

    • Thanks Chris!
      Any chance of you posting your mods somewhere? How did you handle the CF arguments / JS keywords issue?
      Thanks again. It is great to know someone else found it useful!

  2. This worked very well for me. Great work! I also ran into the issues with function arguments throwing javascript errors. I think the best approach for my team is to highlight those spots and change the variable names in the CF. Probably a best-practices issue on our end more than a problem with your code

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s