
Docco is an awesome way to document your code. One complaint I have is that I have to re-run every time I save the file and I'm the type of person who saves and previews a lot. Enter Watchman. Watchman watches a file or directory and executes a command when something changes. Putting the two together, you get something like this:
watchman examples/flickr/flickr.js "docco examples/flickr/flickr.js;chromereload"
Now, every time flickr.js changes, docco re-generates the documentation. You might also notice that I'm running chromereload on change. chromereload is a simple shell script that will automatically reload chrome's active tab. I think you can see where I'm going with this. Now, when I make changes in vim to flickr.js, docco runs and chrome reloads so I don't have to do anything to see updates to my docco documentation.
Here's what the chromereload shell script looks like:
#!/bin/sh
osascript -e 'tell application "Google Chrome" to reload active tab of window 1'
Enjoy documenting your code!