jetbrains.buildServer.web.util
Class ColorerSyntaxHighlighter
java.lang.Object
jetbrains.buildServer.web.util.ColorerSyntaxHighlighter
@NonNls
public class ColorerSyntaxHighlighter
- extends java.lang.Object
Highlights any source code using JHighlight or Colorer library.
|
Method Summary |
static java.lang.String |
getStyle(java.lang.String name)
Returns the style that needs to be embedded in result HTML. |
static java.lang.String |
highlight(java.lang.String source,
java.lang.String name)
Highlighg source and output as styled HTML |
void |
setHighlightEngines(java.lang.String engines)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ColorerSyntaxHighlighter
public ColorerSyntaxHighlighter(SBuildServer server)
setHighlightEngines
public void setHighlightEngines(java.lang.String engines)
highlight
@Nullable
public static java.lang.String highlight(@NotNull
java.lang.String source,
@NotNull
java.lang.String name)
throws java.io.IOException
- Highlighg source and output as styled HTML
- Parameters:
source - textname - source file name to help deduce language
- Returns:
- styled HTML, or null
- Throws:
java.io.IOException - if I/O error occurs
getStyle
@NotNull
public static java.lang.String getStyle(@NotNull
java.lang.String name)
- Returns the style that needs to be embedded in result HTML.
Currently needed only if JHighlight engine is turned on.
- Parameters:
name - the file name to help deduce language
- Returns:
- the required style