previous | index


About this manual

About this manual

This manual is an attempt at literate programming.

The idea for this is simple:

In short, that’s what the KotlinForExample class does. This grew out of my frustration with keeping the documentation in sync with the rapidly changing implementation of the Elasticsearch Kotlin Client.

Eventually, this will move to a separate library once I’m happy enough with how it works. Currently, I’m using this to generate the manual for this project and experimenting a little with this.

And obviously that project will eat its own dogfood to produce a more detailed manual on how to use it self. Here’s a sneak preview of that.

val demoPage = Page("Demo Page", "demo.html")
KotlinForExample.markdownPageWithNavigation(demoPage) {
  +"""
    A quick example. You can put any markdown here.
    Once this code runs, it actually generates the page: [open it here](demo.html)
  """
  blockWithOutput {
    // Block receives a PrintWrite, the output of the block is captured.
    println("Hello world")
  }
  +"""
    Helpers for creating links links are provided:
    
    - You can link to another page ${mdLink(indexPage)}
    - You can link to the source of any class ${mdLink(KotlinForExample::class)}
  """
}

Epub support.

I’m also thinking about eventually publishing an ebook version of the manual at some point. The build currently produces scripts in the epub directory that allow you to create an epub using pandoc. This is very much a work in progress but was a big motivation for me to sink time in creating this little literate programming framework.

You can find the latest epub here.


previous | index

This Markdown is Generated from Kotlin code. Please don’t edit this file and instead edit the source file from which this page is generated.