How to create one gigantic JavaDoc file?
July 9, 2007 8:34 AM   RSS feed for this thread Subscribe

For-a-friend-filter: Help with JavaDoc.

Hive mind, I need your help.

I have about 1,000 files of Java 1.5 source code that has been meticulously documented with javadoc tags. I can use the javadoc tool to produce about 1,000 pages of HTML documenting my code. Now what I really want is a way to generate a single document from the javadoc. The single document could be word, or PDF, or whatever. I’ve looked at Suns MifDoclet, but it doesn’t work with JDK 1.5. Help!!!
posted by Khalad to computers & internet (3 comments total)
A very, very simple (as in "primitive") solution would be to write a shell script that concatenates whatever is inside the body-Tags of every Javadoc-generated HTML file. Should be merely a few lines of code: use a for-loop to iterate over the documents, then for each iteration cat ... | grep ... >> bigfile.html.

If you're going for fancy (rather than just ugly HTML that the browser will eat anyway), you can manually add the correct HTML head segment and the surrounding html-Tags.
posted by Herr Fahrstuhl at 9:09 AM on July 9, 2007


If you use a lexer/parser (such as SableCC, flex/bison, etc) then you can just process the source code yourself and do whatever you want with the javadoc comments.
posted by mbatch at 9:13 AM on July 9, 2007


Writing your own parser is probably overkill, and concatenating the result won't work if there are (admittedly silly) relative intradocument links, "#statement42".

It looks like you can write your own pre-(output)-processor, and use it to determine how the results will be written. Take the standard HTML "doclet" and change it to work as you wish.
posted by cmiller at 11:45 AM on July 9, 2007


« Older What interesting things can I ...   |   Three weeks in Indianapolis! Y... Newer »
This thread is closed to new comments.


Related Questions
What's the hot Java web framework? May 5, 2008
Learning Programming/Logic/Algorithms by Yourself... April 24, 2008
Learning Java on Ubuntu February 12, 2008
How to teach myself computer science? January 12, 2008
Anyone know of a good online Java course? May 11, 2007