- Components
- Source
Source
Source viewer is used to display source code. It provides syntax highlighting for many different languages.
Example
Documentation
<t:source lineNumbers="true" language="java">
public class MyJavaClass {
public static void main(String[] args) {
System.out.println("Syntax highlighting");
}
}
</t:source>
The result will be rendered like this:
public class MyJavaClass {
public static void main(String[] args) {
System.out.println("Syntax highlighting");
}
}
Source viewer is used to display source code. It provides syntax highlighting for many different languages.
Info
Tag name | source |
---|---|
Component type | io.tornadofaces.component.Source |
Renderer type | io.tornadofaces.component.SourceRenderer |
Attributes
Name | Description | Required |
---|---|---|
lineNumbers | Show line numbers. Defaults to true. | false |
language | The language to syntax highlight. Supports 'markup', 'css', 'scss', 'clike', 'javascript', 'java'. Defaults to 'markup'. | false |
styleClass | Styles to apply to the ul element. | false |
style | CSS Styles applied to the ul element. | false |
rendered | Should this component be rendered? | false |