Skip to content

Configuration

kslides has three configuration scopes, each one overriding its parent:

  1. Globalkslides { presentationConfig { } }
  2. Presentationpresentation { presentationConfig { } }
  3. SlidemarkdownSlide { slideConfig { } } (and the same on htmlSlide / dslSlide)

Anything you don't set falls through to the next level up, then to the reveal.js defaults.

Cascading example

fun configCascade() {
  kslides {
    // 1. Global defaults — apply to every presentation
    presentationConfig {
      transition = Transition.SLIDE
      history = true
    }

    presentation {
      // 2. Presentation-level overrides
      presentationConfig {
        transition = Transition.FADE

        slideConfig {
          backgroundColor = "#1f1f1f"
        }
      }

      markdownSlide {
        // 3. Slide-level overrides
        slideConfig {
          backgroundColor = "#2A9EEE"
          transition = Transition.ZOOM
        }
        content { "# Cascading config" }
      }
    }
  }
}

The markdownSlide here ends up with transition = ZOOM (slide-level wins) on a #2A9EEE background, while every other slide in the deck would inherit the presentation's transition = FADE and #1f1f1f background.

Transitions

fun transitionsExample() {
  kslides {
    presentation {
      presentationConfig {
        transition = Transition.CONVEX
        transitionSpeed = Speed.FAST
      }
      markdownSlide { content { "# Convex transition" } }
      markdownSlide { content { "# Same transition applies here" } }
    }
  }
}

Available transitions: NONE, FADE, SLIDE, CONVEX, CONCAVE, ZOOM (see com.kslides.Transition).

reveal.js renders small nav links in the top corners. kslides exposes them as topLeftHref / topRightHref. Set to an empty string to hide them:

fun navHrefs() {
  kslides {
    presentation {
      presentationConfig {
        topLeftHref = "https://github.com/kslides/kslides"
        topRightHref = "" // disable the top-right link
      }
      markdownSlide { content { "# Navigation links" } }
    }
  }
}

What can I configure?

The same DSL exposes every reveal.js setting (history, controls, progress bar, autoslide, …) and a number of kslides-managed extras (menu, copy-code button, code highlighting). Browse the source in com.kslides.config for the full list — every property is documented in-place.