This document provides:

 

These styles can be used in any of the javadocs or web page content.

For example, the following highlighted text is shown on the Juneau website:

All we're doing here is defining our own extended tags in the stylesheet to provide highlights.  

<p class='bcode'>
<jc>// A simple POJO class</jc>
<jk>public class</jk> Person {
<jk>public</jk> String name = <js>"John Smith"</js>;
<jk>public int</jk> age = 21;
}
...
</p> 

Two classes to apply to block elements (typically <p> tags):

The following elements are defined:

 

If marking up the language is too tedious, the sample REST app also includes a code formatter resource:

The formatter resource is not perfect.  For example, it can't detect static methods and fields.  But it's will provide a good starting point, especially for XML.

 

Related issues