PlaygroundConfig

Kotlin Playground embedding options. The top section mirrors the attributes defined by the Kotlin Playground library itself; the lower section controls the iframe wrapper kslides generates around it.

Three separate CSS surfaces, differing by scope:

  • style — inline CSS on the <iframe> element itself, in the surrounding slide's document. Sizes and frames the box; it cannot reach the code inside.

  • fontSize / lineHeight — typed properties rendered by cssText into the iframe's head.

  • css — raw rules, also in the iframe's head, emitted after cssText.

A Playground styling option earns a typed property when it needs a Playground-internal selector or a specificity workaround a deck author cannot reasonably discover (see cssText); anything reachable by an obvious selector stays in css.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Playground args attribute — command-line arguments passed when the code runs.

Link copied to clipboard

Automatically re-indent the code as the user types.

Link copied to clipboard

CSS injected into the generated Playground iframe's <head>, after the rules generated for fontSize — so a rule declared here wins over them at equal specificity. Reach for fontSize first; use this for Playground internals it does not cover.

Link copied to clipboard

Enable autocomplete in the Playground editor.

Link copied to clipboard

Toggle for Playground's "open in IDE" crosslink button.

Link copied to clipboard

When true, disables the Run button and just syntax-highlights the code.

Link copied to clipboard

Space-separated list of JS library URLs loaded before JS-target code runs.

Link copied to clipboard

Minimum Kotlin compiler version that must be available on the Playground backend.

Link copied to clipboard

Maximum output-pane height in pixels.

Link copied to clipboard

CodeMirror scrollbarStyle (e.g. "simple", "null").

Link copied to clipboard

Shorter editor height variant (pixels).

Link copied to clipboard

Execution target for the embedded code (e.g. JVM, JS, JUnit).

Link copied to clipboard

When true, collapses the editor behind a "Show code" button.

Link copied to clipboard

Font size of the code in the Playground editor and its run-output pane — any CSS length. Blank keeps Playground's own default.

Link copied to clipboard
var from: Int

First line to display from the source file (1-based).

Link copied to clipboard

iframe height attribute. Default "250px".

Link copied to clipboard

Re-highlight code while it is being edited.

Link copied to clipboard
var indent: Int

Editor indentation width in spaces.

Link copied to clipboard

line-height for the Playground editor and run-output pane — a unitless ratio ("1.4") or a CSS length. Blank keeps CodeMirror's own ratio, which already scales with fontSize; set this only to tighten or loosen the spacing itself.

Link copied to clipboard

Show line numbers.

Link copied to clipboard

Highlight matching brackets in the editor.

Link copied to clipboard

Language/syntax mode the editor operates in.

Link copied to clipboard

When true, the generated Playground HTML is cached for the lifetime of the com.kslides.KSlides instance. Set to false only if the Playground content depends on runtime state that changes between requests.

Link copied to clipboard

Inline CSS applied to the iframe. Useful for adding borders while tuning layout.

Link copied to clipboard

Editor color theme.

Link copied to clipboard

Accessible title text for screen readers.

Link copied to clipboard
var to: Int

Last line to display from the source file (inclusive).

Link copied to clipboard

iframe width attribute. Default "100%".

Functions

Link copied to clipboard
fun css(block: CssBuilder.() -> Unit)

Append CSS (via the Kotlin CSS DSL) to the Playground iframe's stylesheet.

Link copied to clipboard
open fun merge(other: AbstractConfig)

Merge other into this config in place: every entry from other's two maps is copied into this config's maps, with later puts overwriting earlier keys. This is how the global → presentation → slide cascade resolves (parent merged first, then child).

Link copied to clipboard
open fun revealjsOption(key: String, value: Any)

Set a raw reveal.js config option by key for options kslides does not expose as a typed property (e.g. the menu plugin's themes array). The value is emitted verbatim into the Reveal.initialize({...}) call and participates in the config cascade like any other option. Prefer the typed properties where they exist.