SyntaxHighlighter

Class

For examples and usage details, see the component documentation.

View SyntaxHighlighter Component
Namespace: RazorConsole.Components
Assembly: RazorConsole.Core

Definition

public class SyntaxHighlighter : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender

Constructors

1
NameTypeDescription
SyntaxHighlighter()Constructor

Properties

7
NameTypeDescription
Appearance
TabWidthNullable<Int32>Width of tab characters in spaces. When specified and greater than 0, overrides tab width in Options.
Other
AdditionalAttributesIReadOnlyDictionary<String, Object>Additional HTML attributes for the syntax highlighter element.
CodeStringSource code to highlight.
LanguageStringProgramming language of the code. If null , attempts automatic detection. Supported: "csharp", "javascript", "python", "sql", etc.
OptionsSyntaxOptionsAdditional syntax highlighting options. If null , uses Default.
ShowLineNumbersBooleanWhether line numbers should be displayed. Default is false .
ThemeStringColor theme for syntax highlighting. If null , uses default theme.

Methods

2
NameTypeDescription
BuildRenderTree(RenderTreeBuilder)()Method
OnParametersSet()MethodCalled when component parameters are set. Processes the code through syntax highlighting and encodes the result.