Back to
Plugin Home
Highlighters
Introduction
This feature allow highlight code of any language and etc. It fing and color the keywords or matched regular expressions.
Syntax of definition
To define you custom highlighter you must define in this topic follow entry:
%CODE:DEF{"java"}%
here put formatters to replace reserved words, strings, etc. See
PhantomPluginFormatters topic.
%CODE:END%
Using
Imagine that we define highlighter "java", then we can use:
%CODE:JAVA%
/* Block comment */
import java.util.Date;
/**
* Doc comment here for <code>SomeClass</code>
* @version 1.0
*/
public class SomeClass { // some comment
private String field = "Hello World";
private double unusedField = 12345.67890;
private UnknownType anotherString = "AnotherString";
public SomeClass() {
//TODO: something
int localVar = "IntelliJ"; // Error, incompatible types
System.out.println(anotherString + field + localVar);
long time = Date.parse("1.2.3"); // Method is deprecated
}
}
%CODE:END%
See also
PhantomPluginFormatters
--
AlexeyEfimov - 17 Nov 2002