CodeSnippetConfig

Receiver for com.kslides.codeSnippet blocks. Describes a single reveal.js <pre><code> element with optional line highlighting, line numbers, and a copy-to-clipboard button.

Append to code by using the unary-plus operator inside the block: +"val x = 1".

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

The code text that will appear inside <code>. Append via the unary-plus operator.

Link copied to clipboard

When true, attaches a "COPY" button (requires the CopyCode reveal.js plugin).

Link copied to clipboard

Custom message shown while the "copied" state is active.

Link copied to clipboard

Custom button label (defaults to the plugin's "Copy" text).

Link copied to clipboard

reveal.js data-id used to auto-animate transitions between code snippets.

Link copied to clipboard

When true, the HTML is escaped (default reveal.js behavior). Set to false (which emits data-noescape) when the snippet is already escaped or when you want to embed raw HTML.

Link copied to clipboard

reveal.js data-line-numbers pattern (e.g. "1-3|5"). Blank turns on all line numbers; the literal string "none" disables line numbers entirely.

Link copied to clipboard

<code> class used by highlight.js / reveal.js to pick a language. Defaults to "kotlin".

Link copied to clipboard

Starting line number (data-ln-start-from). -1 omits the attribute.

Link copied to clipboard

When true, emits data-trim so reveal.js strips leading/trailing whitespace.

Functions

Link copied to clipboard
operator fun String.unaryPlus()

Append this string to code. Used inside the codeSnippet {} block as +"…".