DSL

declslides.dsl.DSL
object DSL

Public DSL for building presentations in a small, declarative style.

The DSL is split into two levels:

  • presentation-level builders, used to compose a whole deck
  • slide-level builders, used to compose the content of a single slide

The public entry point is presentation, which can be used either with the default theme or with an explicit theme configuration.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
DSL.type

Members list

Type members

Classlikes

Presentation builder with all global configuration already chosen.

Presentation builder with all global configuration already chosen.

Attributes

Supertypes
class Object
trait Matchable
class Any
final case class PendingSlide(title: String, layout: Layout, elements: Vector[SlideElement])

Slide collected during DSL evaluation, before full validation happens.

Slide collected during DSL evaluation, before full validation happens.

The DSL builds slides in two stages: first as lightweight pending values, then as fully validated domain slides.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class PresBuild(run: PresentationState => PresentationState)

Presentation-level builder.

Presentation-level builder.

A PresBuild is just a transformation of PresentationState, but giving that transformation a dedicated type makes the DSL much easier to read.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class PresentationConfig(title: String, theme: Theme, footer: Option[String] = ...)

Immutable configuration for a presentation before content is evaluated.

Immutable configuration for a presentation before content is evaluated.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final class PresentationStart(title: String)

Entry point for configuring a presentation before its body is evaluated.

Entry point for configuring a presentation before its body is evaluated.

This type exists to make the DSL read naturally while keeping configuration concerns, such as theme selection, separate from content.

Attributes

Supertypes
class Object
trait Matchable
class Any
final case class PresentationState(title: String, theme: Theme = ..., footer: Option[String] = ..., pendingSlides: Vector[PendingSlide] = ...)

Mutable-in-spirit state threaded through presentation-level builders.

Mutable-in-spirit state threaded through presentation-level builders.

Despite its name, the state remains immutable: each builder returns a new state rather than mutating the existing one.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class SlideBuild(run: SlideState => SlideState)

Slide-level builder.

Slide-level builder.

A SlideBuild describes how to extend the content of a single slide.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class SlideState(title: String, layout: Layout, elements: Vector[SlideElement] = ...)

Immutable state threaded through slide-level builders.

Immutable state threaded through slide-level builders.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def bullets(items: String*): SlideBuild

Adds a bullet list to the current slide.

Adds a bullet list to the current slide.

Attributes

def code(language: String, source: String): SlideBuild

Adds a code block to the current slide.

Adds a code block to the current slide.

Attributes

def content(items: SlideBuild*): SlideBuild

Combines slide-level builders into a single slide body.

Combines slide-level builders into a single slide body.

Attributes

def deck(items: PresBuild*): PresBuild

Combines presentation-level builders into a single deck definition.

Combines presentation-level builders into a single deck definition.

Attributes

def image(source: URL, altText: String): SlideBuild

Adds an image to the current slide.

Adds an image to the current slide.

Attributes

def presentation(title: String): PresentationStart

Starts a presentation definition.

Starts a presentation definition.

Typical usage:

presentation("Demo").use(Theme.conference) {
 deck(
   slide("Intro") {
     content(text("Hello"))
   }
 )
}

Attributes

def slide(title: String, layout: Layout = ...)(body: => SlideBuild): PresBuild

Adds a slide to the current presentation.

Adds a slide to the current presentation.

Value parameters

layout

visual layout used by renderers

title

slide title

Attributes

def spacer(lines: Int = ...): SlideBuild

Adds vertical spacing to the current slide.

Adds vertical spacing to the current slide.

Attributes

def text(value: String): SlideBuild

Adds a paragraph to the current slide.

Adds a paragraph to the current slide.

Attributes