Presentation

class Presentation(val kslides: KSlides)

A single presentation — the unit that reveal.js renders as one HTML page. Created via KSlides.presentation and populated with slide definitions, per-presentation configuration, and scoped CSS.

Not intended to be constructed directly by user code.

Constructors

Link copied to clipboard
constructor(kslides: KSlides)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

CSS scoped to this presentation, seeded from KSlides.css. Appended via the css DSL block or css += "..." / css += { ... }.

Link copied to clipboard

Per-presentation list of CSS <link> files injected into the generated <head>. Seeded from com.kslides.config.KSlidesConfig.cssFiles; theme and highlight stylesheets are appended automatically during page rendering.

Link copied to clipboard

Per-presentation list of JavaScript <script> files injected into the generated page. Seeded from com.kslides.config.KSlidesConfig.jsFiles; reveal.js plugins are appended automatically when the corresponding PresentationConfig flags are enabled.

Link copied to clipboard

the owning KSlides instance; provides access to global config and shared caches (iframe content, Kroki content).

Link copied to clipboard

The URL path (HTTP mode) or output filename/directory (filesystem mode) for this presentation. Defaults to "/", which writes to docs/index.html or serves at the server root. Must be unique across presentations and must not collide with a registered static asset directory (com.kslides.config.KSlidesConfig.httpStaticRoots).

Functions

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

Append CSS (declared via Kotlin's CSS DSL) to this presentation's stylesheet. Can be placed anywhere inside the presentation{} block — unlike raw HTML, CSS does not have to appear at the top.

Link copied to clipboard

Add a horizontal slide whose content is authored with the kotlinx.html DSL. This is the only slide type that supports the extension DSLs com.kslides.playground, com.kslides.diagram, com.kslides.codeSnippet, and (from the kslides-letsplot module) letsPlot{}.

Add a kotlinx.html DSL slide inside a verticalSlides block. Same semantics as the top-level dslSlide but registered with the enclosing VerticalSlidesContext.

Link copied to clipboard

Add a horizontal slide whose content is a raw HTML string supplied via content {}.

Add a raw-HTML slide inside a verticalSlides block. Same semantics as the top-level htmlSlide but registered with the enclosing VerticalSlidesContext.

Link copied to clipboard

Add a horizontal Markdown slide. Content comes from either a content {} block (inline Markdown) or a filename pointing at an external .md file.

Add a Markdown slide inside a verticalSlides block. Same semantics as the top-level markdownSlide but registered with the enclosing VerticalSlidesContext.

Link copied to clipboard

Configure reveal.js / kslides options scoped to this presentation. Values set here override the global KSlides.presentationConfig for this presentation only.

Link copied to clipboard
fun slideDefinition(source: String, token: String, title: String = "Slide Definition", highlightPattern: String = "[]", id: String = "", language: String = "kotlin")

Generate a Markdown "meta" slide that embeds a highlighted code excerpt from source between // <token> begin and // <token> end markers, and appends a "GitHub Source" link pointing at the same region on master. Primarily used by the kslides example deck to explain its own DSL.

fun VerticalSlidesContext.slideDefinition(source: String, token: String, title: String = "Slide Definition", highlightPattern: String = "[]", id: String = "", language: String = "kotlin")

Vertical-stack variant of slideDefinition. Identical semantics but registers the generated Markdown slide inside the enclosing VerticalSlidesContext.

Link copied to clipboard

Group one or more slides vertically (reveal.js "vertical stacks"). Inside the block, use markdownSlide, htmlSlide, or dslSlide to add slides; they are stacked top-to-bottom in the order declared and share a single <section> wrapper so the whole stack can share a background, CSS class, or VerticalSlidesContext.slideConfig.