Method |
Description |
|
GetDefaultCssClassTable ( ) : string[] |
The lookup table of strings for control codes (LesColorCode values) to HTML classes. For example, GetDefaultCssClassTable()[(int)LesColorCode.Number] indicates the default CSS class to use for numbers. If the entry for a given code is null, no span element is emitted, which shortens the output. The default class names are shared with the Pygments syntax highlighting system. A list of the CSS classes available in Pygments is available at this link. Only a small subset of these classes are used in this table. Here is some suitable CSS: .highlight { background-color: #f8f8f8; color: #111; } .highlight .c { color: #5A5; } /* Comment */ .highlight .n { color: #111; } /* Name (omitted by default) */ .highlight .m { color: #909; } /* Number */ .highlight .s { color: #B44; } /* String */ .highlight .l { color: #B04; } /* Literal (other) */ .highlight .kc { color: #41F; } /* Keyword.Constant */ .highlight .o { color: #940; } /* Operator */ .highlight .p { color: #111; } /* Punctuation (omitted by default) */ .highlight .kp { color: #33A; } /* Keyword.Pseudo (@attribute) */ .highlight .nb { color: #007; } /* Name.Builtin (#specialId) */ .highlight .k { color: #11F; } /* Keyword (.dotId) */ .highlight .x { color: #D00; } /* Other */ .highlight .pi { color: #B50; } /* Parenthesis Inner (()) */ Note: LesTokenCode.Opener and LesTokenCode.Closer are handled specially. An opener and its matching closer (e.g. '(' and ')') are always given the same color, but nested parens/brackets are given alternating colors (CSS classes), with the entry for LesTokenCode.Opener used for outer parens and the entry for LesTokenCode.Closer used for inner parens. The default class name is "pi" for inner parentheses; no class name is used for outer parens. "pi" is not a standard name, so if you're using a standard Pygment stylesheet you should add an extra line, e.g. .highlight .p { color: #111; } /* Punctuation (includes , ; { }) */ .highlight .pi { color: #B50; } /* Parenthesis Inner */ |
|
Les3PrettyPrinter ( IMessageSink sink = null, ILNodePrinterOptions options = null ) : System |
Creates an instance of this class, which produces plain LES augmented with control codes. |
|
Les3PrettyPrinter ( StringBuilder target, IMessageSink sink, ILNodePrinterOptions options ) : System |
Creates an instance of this class, which produces plain LES augmented with control codes. |
|
PrintToConsole ( IEnumerable nodes, bool endWithNewline = true ) : void |
|
|
PrintToConsole ( ILNode node, bool endWithNewline = true ) : void |
|
|
PrintToConsoleCore ( StringBuilder input, bool endWithNewline = true ) : void |
|
|
PrintToHtml ( IEnumerable nodes, StringBuilder output = null, bool addPreCode = true ) : StringBuilder |
|
|
PrintToHtml ( IEnumerable nodes, StringBuilder output = null, bool addPreCode = true, IMessageSink sink = null, ILNodePrinterOptions options = null ) : StringBuilder |
Prints an LNode as LESv3 with HTML syntax highlighting elements. |
|
PrintToHtml ( ILNode node, StringBuilder output = null, bool addPreCode = true ) : StringBuilder |
|
|
PrintToHtmlCore ( StringBuilder input, StringBuilder output = null, bool addPreCode = true, string newline = "\n", string colorCodesToCssClasses = null ) : StringBuilder |
Converts a StringBuilder with LesColorCode control codes to HTML with Pygments CSS class codes. |
|