Orchid Kotlindoc


Orchid Kotlindoc

Embed Kotlin and Java documentation in your Orchid site using Dokka.

Using Orchid with Dokka

The Orchid Kotlindoc plugin runs Dokka for you, using a formatter which outputs JSON. This makes it easy for Orchid to convert data generated by Dokka into something that is easily usable from Orchid. Just include the plugin, point it to the directories containing Kotlin or Java source files, and away you go!

This plugin works with Dokka JSON to produce a documentation model for your code, and then translates that model into Orchid pages in a similar way to the Orchid Javadoc or Orchid Swiftdoc plugins.

The classes can reference pages in other Orchid sites' docs by adding their index JSON to your build. For example, you can add https://orchid.netlify.com/meta/kotlindoc.index.json to your site's config.yml so that your docs will link out to the Orchid doc pages. This works with class pages generated from either the Javadoc or Kotlindoc plugins.

      - 'https://orchid.netlify.com/meta/kotlindoc.index.json'

Orchid itself is written in Kotlin and documented with this Kotlindoc plugin. You can preview the generated documentation here.

Dokka Configuration

This plugin delegates to Dokka to provide the documentation model. It will fetch the necessary jars and run Dokka using the command line, and you are able to add any additional arguments you wish.

First, you may specify the --kotlindocClasspath flag to Orchid, which will forward this value to Dokka's -classpath arg. Example usage when running Orchid from Gradle looks like the following:

orchid {
    args = ["--kotlindocClasspath", getModuleClasspathString()]

In addition, you may specify a full list of args in your config.yml which will be passed-through to Dokka.

    - '-classpath'
    - '...'

Include with:
dependencies {
    orchidRuntime 'io.github.javaeden.orchid:OrchidKotlindoc:0.16.10'