Installing Docco on Windows

Docco is a literate-programming-style documentation generator, which can produce visually appealing and fantastically useful documentation, just that for the backbone.js source code and Docco's own project website.

Whilst its a snap to setup on *nix systems, you may find a Windows installation a little more taxing. Here is a step-by-step guide to get Docco running on Windows in no time at

  1. Download and install Node.js using its windows installer (MSI).
  2. Download Python. Again it has a Windows Installer, which you should run using the default options.
  3. You need to 'Edit Environment Variables' - in Windows 7, etc. you can just click the Start button and search for this. Otherwise follow these instructions for Windows XP.
  4. Add a new System Variable called NODE_PATH - pointing to its location (on 64-bit systems, this should be C:\Program Files (x86)\nodejs).
  5. Add a new System Variable called PYTHON_PATH - pointing to its location (this should be at C:\Python[Version] - in my case Python27).
  6. Find the existing PATH System variable and click the Edit button.
  7. Add the following at the end of the existing PATH value: ;C:\Python27;C:\Python27\Scripts (where C:\Python27 matches your PYTHON_PATH value in step 5).
  8. Download the latest version of Python Setuptools for your version of Python and install them.
  9. Grab the latest copy of CoffeeScript and extract the download contents to C:\Program Files (x86)\nodejs\node_modules\coffee-script\ (C:\Program Files... on non 64-bit systems).
  10. Grab a copy of Docco itself and again extract it to C:\Program Files (x86)\nodejs\node_modules\docco\
  11. Download a copy of Pygments 1.4 and extract it to C:\Python27\Scripts\pygments-1.4.
  12. Open a command prompt (as Administrator) and navigate to C:\Python27\Scripts\pygments-1.4
  13. Run the following command: python setup.py install
  14. Create a file called coffee.cmd in C:\Program Files (x86)\nodejs and paste in the following:
    @echo off
    node.exe %~dp0.\node_modules\coffee-script\bin\coffee %*
  15. Create a file called docco.cmd in that same directory and paste in:
    @echo off
    node.exe %~dp0.\node_modules\docco\bin\docco %*

If all has gone well, you should now be able navigate within the command prompt to a directory containing a JavaScript file and run docco filetodocument.js to create documentation. Docco will place the generated documentation in a relative path of docs/.

Note, if you're installing on a build machine of some kind, I recommended that you restart the machine in order to ensure that all services pick up the adjusted PATH variable.