Adds code highlighting CSS styles.
- Namespace
- Statiq
.Highlight - Interfaces
- Base Types
-
- object
- SyncShortcode
graph BT
Type-->Base0["SyncShortcode"]
click Base0 "/api/Statiq.Common/SyncShortcode"
Base0-->Base1["object"]
Type-.->Interface0["IShortcode"]
click Interface0 "/api/Statiq.Common/IShortcode"
Type["HighlightShortcode"]
class Type type-node
Syntax
public class HighlightShortcode : SyncShortcode, IShortcode
Examples
Example usage:
<?# highlight csharp ?>
public class Foo
{
int Bar { get; set; }
}
<?#/ highlight ?>
Example output:
<code class="language-csharp hljs"><span class="hljs-keyword">public</span> <span class="hljs-keyword">class</span> <span class="hljs-title">Foo</span>
{
<span class="hljs-keyword">int</span> Bar { <span class="hljs-keyword">get</span>; <span class="hljs-keyword">set</span>; }
}</code>
Remarks
This module pre-generates highlight.js (https://highlightjs.org) code highlighting styles.
Note that a highlight.js stylesheet must still be referenced for the styles to render in different colors.
Methods
Name | Return Value | Summary |
---|---|---|
Execute |
ShortcodeResult |