Question

In my application, I have a requirement to convert Java/VB/VB.net/etc program to HTML, and then use that HTML page (to insert in Word doc).

Sure we can write code for this, but this will entail programming for this too, and from more than one programming languages, and dealing with bugs. Whereas it needs to be released ASAP. Using 3rd party tool for this HTML generation is not an issue.

However this 3rd party tool, code to html formatter, should be free, robust, and should convert upto Java 1.5, and other language's recent version.

Do you know of any such converter (code to html converter/formatter) which is free, distributable, robust, and converts upto recent versions of more than one languages (including Java)?

To elaborate further, I am interested in a utility which will take source code file as input, and will generate HTML file as output. The HTML file should not use javascript to color the code, because then inserting in Word the coloring will be lost.

Was it helpful?

Solution

OTHER TIPS

If you want to go with the JavaDoc way, I would recommend using Natural Docs. However, if you want to simply show the Java and convert into a CSS formatted HTML section on your page, I would recommend using Google's Code Prettify. Check out the link to README for examples. You can also check out the Java Test Page to see how the Java will look.

Javadoc will convert your code to HTML (along with the associated class trees and linkages, etc), but doesn't syntax highlight the code unfortunately. What you could do is add the Google Code Prettifier to each page, which could work.

I'm using Java2HTML. It runs as Eclipse plugin, and also from commandline or as ant script.

It can also convert to TeX and XML.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top