We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
Tags:
create new tag
, view all tags

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

Topic revision: r4 - 15 Jul 2005 - 06:28:46 - PeterThoeny
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback