Do the inline documentation with the apiDoc format[1]. Readme.io has also created and documented a superset of apiDoc that you might want to look into. Obviously their tool supports it, but it seems easy to roll your own frontend for the API data once you extract it from your code.