/kotlin-dsl

Primary LanguageKotlinApache License 2.0Apache-2.0

kslides Template

GitHub release (latest by date) Build Status Kotlin version Netlify Status

A template repo for authoring kslides presentation.

Getting Started

Template

To create a kslides presentation, generate a new repository using this repo as a template.

All changes to this template are documented in the CHANGELOG.md file. Check back occasionally for any changes that should to be incorporated into your kslides repo.

Creating Slide Content

Open your newly created kslides repo with IntelliJ and edit the src/main/kotlin/Slides.kt file. The kslides repo README.md describes the various kslides blocks.

Static Content

Presentations served by HTTP load static content from /src/main/resources/public, whereas filesystem presentations load static content from /docs.

Make sure to run ./gradlew clean build after making changes to /src/main/resources/public.

Deployment Options

Deploy to GitHub Pages

  1. Go to your kslides content repo on GitHub
  2. Click on Settings -> Pages
  3. Under Source, choose the master branch and the /docs folder and click on Save
  4. Open the src/main/kotlin/Slides.ht file
  5. Ensure the output{} block contains: enableFileSystem = true
  6. Click on the green arrow next to the fun main() declaration to run the program and generate the html content in the /docs folder
  7. Add the newly generated html files in the /docs folder to git
  8. Commit and push the changes to GitHub
  9. Wait a minute or so and your slides will be available at https://username.github.io/repo_name/

Deploy to Netlify

  1. Create an account on Netlify
  2. Click on Add a new site -> Import and existing project
  3. Click on the GitHub button and select your slides repo
  4. Go to your Netlify dashboard and click on the newly added repo.
  5. To edit your Netlify subdomain name, click on the Domain settings button and then click on the Options button
  6. Your repo already has a netlify.toml file that will instruct Netlify to use your /docs folder as an html source
  7. Open the src/main/kotlin/Slides.ht file
  8. Insure enableFileSystem = true is set in the output{} block
  9. Click on the green arrow next to the fun main() declaration to run the program and generate the html content in the /docs folder
  10. Add the newly generated html files in the /docs folder to git
  11. Commit and push the changes to GitHub
  12. Wait a minute or so and your slides will be available at https://site-name/netlify.app/

Deploy to Heroku

  1. Create an account on Heroku
  2. Install the Heroku CLI
  3. Open the src/main/kotlin/Slides.ht file
  4. Ensure the output{} block contains: enableHttp = true
  5. Create a new Heroku app with: heroku create slideshow_name
  6. Commit and push the changes to Heroku with: git push heroku master
  7. Open the app in a browser with: heroku open

build.gradle

The build.gradle file uses these repositories:

repositories {
    google()
    mavenCentral()
    maven { url = 'https://maven.pkg.jetbrains.space/mipt-npm/p/sci/maven' }
    maven { url = 'https://jitpack.io' }
}

and has these dependencies:

dependencies {
    implementation "com.github.kslides.kslides:kslides-core:$kslides_version"
    implementation "io.ktor:ktor-server-html-builder:$ktor_version"
    implementation "org.jetbrains.kotlin-wrappers:kotlin-css:$css_version"
    implementation "com.github.pambrose:srcref:$srcref_version"
    implementation "space.kscience:plotlykt-core:$plotly_version"
}