Hwaro::Models::HighlightConfig
Inherits Reference / Object
Syntax highlighting configuration
Constants
Copy-to-clipboard runtime for pre[data-copy] blocks: one DOM pass
on DOMContentLoaded, appends a button, and copies the code's text on
click. An existing .code-block (named fences) or .code-wrapper
parent is reused as the positioning anchor — inserting a new wrapper
inside .code-block would break its .code-block > pre styling —
otherwise the
is wrapped in a fresh.code-wrapper. Copied text strips the baked-in.lnline-number gutter spans (server-modelinenos) so pasted code has no number prefixes. Theme-neutral — currentColor only, revealed on hover/focus — and small enough to inline, so no extra request in either highlight mode.
Constructors
Instance methods
Adds a copy-to-clipboard button to fenced code blocks (per-block
{copy=false}/{copy=true} overrides). Off by default so existing
output is byte-identical.
Adds a copy-to-clipboard button to fenced code blocks (per-block
{copy=false}/{copy=true} overrides). Off by default so existing
output is byte-identical.
Generate the JS script tag for highlighting. Server-side highlighting needs no JavaScript at all — unless the copy button is on, whose (dependency-free) runtime ships either way.
Global default for fence-level linenos (see FenceOptions): when
true, every fenced code block with a language gets line numbers
unless it opts out with a per-block {linenos=false}. Off by
default so existing output is unaffected.
Global default for fence-level linenos (see FenceOptions): when
true, every fenced code block with a language gets line numbers
unless it opts out with a per-block {linenos=false}. Off by
default so existing output is unaffected.
"server" (default) highlights at build time (Tartrazine lexers, hljs-compatible CSS classes) so no JavaScript ships; "client" injects Highlight.js and highlights in the browser — theme CSS keeps working either way.
"server" (default) highlights at build time (Tartrazine lexers, hljs-compatible CSS classes) so no JavaScript ships; "client" injects Highlight.js and highlights in the browser — theme CSS keeps working either way.