One way to generate documentation is - you guessed it - javadoc. You simply have to comment the same way you usually do, and javadoc does a good job of converting them to HTML/LaTeX style.
Of course, that's not the only solution. I'll leave room for others.