Many (around 5) years ago I wrote a library that parsed PHP files and generated logical "anchors" after classes and functions. I combined that with a simple CRUD application that allowed anyone to view source code in the browser and add/change comments dynamically.
doc_code2html() takes PHP code as argument, and uses built-in PHP tokenizer to add CSS classes to code. After that, you can use vanilla CSS to color things up. Up to this day this is the simplest and most accurate PHP highlighter I've seen.
doc_getCodeAnchors() takes php code as argument and returns an associative array of anchors. I.e.:
It's similar to literate programming, which consists in exchanging the focus between code and comments. I believe that Coffeescript just got a literate processor, so the community may benefit from this in the near future. Because GHC supports it, it is also very popular in the Haskell community.
i actually find docco-style docs more difficult to read with mostly single-line notes due to the spacing :(
some sort of block folding would help a lot to follow code progression like a story. i'm not certain this is the best display type for all commenting styles.
docco: http://jashkenas.github.io/docco/
I just checked out jquery and built it myself. Here's a newer version:
http://shalecraig.com/docs/manipulation.html