File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes making source code viewable on my website Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "making source code viewable on my website" Watch "making source code viewable on my website" New topic
Author

making source code viewable on my website

Jim Rock
Ranch Hand

Joined: Mar 20, 2001
Posts: 39
Is there a freeware tool that will take my .java and .jsp files and create .html file showing my source code
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Do you need syntax highlighting or anything fancy like that? Most web browsers can display plain text files, like your source code. If you simply upload the files to your website and create links to them, then visitors can view your code just fine. In fact, I use these technique at my C++ website.


Java API Documentation
The Java Tutorial
Jim Rock
Ranch Hand

Joined: Mar 20, 2001
Posts: 39
Thanks. I looked at your website Game of Life example. The C+ code viewed fine. The Java code did not.
I will experiment with your idea and see what I come up with. Thanks.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
While researching parsers I found a free tool that converts Java to HTML with color coding. The bad news: I can't find it again!
Another tool I can't find again put links to source code into JavaDoc. I thought that was very nice.
Sorry I don't have links to these things, but hope you find them encouraging in your own search.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
D'oh! Found a couple. These are not the same product, in spite of the interesting similarity of the addresses:
http://www.java2html.de/ - standalone app or applet to format Java to HTML.
http://www.java2html.com/ - Formats Java to HTML and links it into JavaDoc
Jim Rock
Ranch Hand

Joined: Mar 20, 2001
Posts: 39
Thanks Stan, I'll take a look at both products
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
The Java source loads just fine in IE on the computers here at school. It may have to do with file type settings on the viewers platform. I guess I assume that if a user can't view the code directly in the web browser, then they probably know how to save it to a local file and view it in a text editor.
Jim Rock
Ranch Hand

Joined: Mar 20, 2001
Posts: 39
I agree Layne it is no hardship to download the source and view in an editor - that worked.
I also loaded some .java .jsp and .xml files into MS Word and saved as an HTML file and that produces excellent results - viewable in both IE and Netscape directly.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
In Windows I have associated extension Java with my favorite text editor. Source files on my site are stored with extension Java and normal hyperlinks to them. When I click, the browser downloads a temp file and opens the text editor. The problem with this is that the next guy might have Java associated with nothing, or something odd and might get undesired results. The Java2HTML tools would be more reliable for the general public to look at your code.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: making source code viewable on my website