Friday December 05, 2003
[JSPWiki] Sweet Java/HTML/XML syntax coloring
I found
a very nice plugin for JSPWiki this morning: the Java to HTML converter
.
- This tool converts Java source code (files and snipplets) to HTML, RTF, TeX and XHTML with syntax highlighting. It is Open source under the GPL.
I've found that it works for Java, XML and HTML. Here's a couple of examples (I've hooked it into Roller's JSPWiki support):
Java
/**
|
HTML
<html>
|
XML
|
The one thing I don't like is that it centers the code using <center>, adding "center table {width: 100%}" to your stylesheet fixes the issue. I also tried to upgrade Roller's JSPWiki.jar to 2.1.86-alpha (to get XHTML support), but I was getting all kinds of stacktraces from OSCache and it just didn't work. Java2Html also has an Ant Task
to convert Java source to HTML. Java2HTML
has the same thing, but this new one supports different styles
.
NOTE: The above syntax coloring produces invalid XHTML, so this site won't validate for awhile.
Posted in Java at Dec 05 2003, 01:02:08 PM MST 4 CommentsSearch This Site
Recent Entries
- Wine Tasting in Napa Valley
- How to build a Shot-Ski
- Bus Project Update
- Farewell to the 2011-2012 Ski Season
- Cruising around the Western Caribbean
- Spring Break!
- A Spectacular Trip to Stockholm and Madrid
- Comparing Web Frameworks and HTML5 with Play Scala at Jfokus 2012
- Play Framework 2.0 with Peter Hilton at Jfokus
- Secure JSON Services with Play Scala and SecureSocial
Posted by Simon Harris on December 05, 2003 at 08:10 PM MST #
Posted by Markus Gebhard on December 07, 2003 at 04:15 PM MST #
Posted by Matt Raible on December 07, 2003 at 11:02 PM MST #
/* for the java2html plugin - so everything is not centered */ center table { width: 100%; border: 1px solid #c0c0c0; } center table td { padding: 10px; padding-bottom: 0; } center table code {position: relative; top: -10px}With 3.5, I can do the same thing with the following:div table { width: 100%; border: 1px solid #c0c0c0; } div table td { padding: 10px; padding-bottom: 0; } div table code {position: relative; top: -10px}But any <table>'s inside of <div>'s will get this rule applied to it. Would it be possible to put a class on the java2html <div>? For example <div align="left" class="java">. Just a suggestion, luckily, I don't have any table's in my div's and my altered CSS above works fine with 3.5.Posted by Matt Raible on December 08, 2003 at 05:45 PM MST #