Jonathan Challinger's website
HOME

Projects

Java API

Send me mail.




Source

JRainbow.jar

JRainbow is a Java to HTML converter, which adds HTML tags to Java source Example output.

Update(3-15-05): Now supports multiple files and wildcards.

Usage:

java -jar JRainbow.jar [-cssfile <css file>] <java input files ...>

The output files will all be named JavaFile.html (Example: "Example.java.html".)
If you do not provide a stylesheet the default will be used.

Default stylesheet:

body
{
  cursor:default;
  color:#00ff00;
  background:#000000;
}
.keyword
{
  font-weight:bold;
  color:#ff0000;
}
.type
{
  color:#ff0000;
}
.literal
{
  color:#3333ff;
}
.comment
{
  color:#888888;
  font-style:italic;
}
.bracket
{
  color:#ff7c00;
}
.operator
{
  color:#ffff00;
}
.bracketOver
{
  color:#ff7c00;
  background:#ffffff;
}
a
{
  text-decoration: none;
  cursor: default;
  color:#ffffff;
}
a:hover
{
  text-decoration: none;
  cursor: default;
  background: #888888;
}

Ideas for future releases (in order of likeliness of actually happening):

Add line numbers/javascript to set status bar to the line number that the mouse is over.

Make it less dependant on javascript.

Support multiple file formats such as rtf.

One-foot diameter meteorite falls through the roof and kills me.

Support multiple languages (c, c++, html, etc.) (I don't want to do this because it involves too much work)

Known bugs:

(FIXED)Does not work properly on files that aren't formatted by windows (windows adds a wierd character to line breaks).

(FIXED)Wildcard in import blank.blank.*; is handled as an operator.

JRainbow generates valid html!!!

JRainbow generates Valid HTML 4.01! valid html 4.01 strict,
and the default style sheet is Valid CSS! valid css.

Note that this page probably does not validate. THE ABOVE LINKS ARE FOR PAGES THAT JRainbow GENERATED. Click here for the validation for this page.




BACK | HOME
jschall@ecst.csuchico.edu
jonathan@pmtech.com