bld Extension to Generate API Documentation with Dokka for Kotlin https://github.com/rife2/bld-dokka
Find a file
Erik C. Thauvin 0a6be415e9
Some checks are pending
bld-ci / build-bld-project (17, 1.9.24) (push) Waiting to run
bld-ci / build-bld-project (17, 2.1.0) (push) Waiting to run
bld-ci / build-bld-project (21, 1.9.24) (push) Waiting to run
bld-ci / build-bld-project (21, 2.1.0) (push) Waiting to run
bld-ci / build-bld-project (23, 1.9.24) (push) Waiting to run
bld-ci / build-bld-project (23, 2.1.0) (push) Waiting to run
javadocs-pages / deploy (push) Waiting to run
Bumped PMD extension to version 1.1.9
2024-12-28 17:48:30 -08:00
.github/workflows Bumped dependencies 2024-12-19 07:13:10 -08:00
.idea Bumped bld to version 2.1.0 2024-08-30 16:29:38 -07:00
.vscode Bumped bld to version 2.1.0 2024-08-30 16:29:38 -07:00
config Updated dependencies 2024-10-27 16:22:57 -07:00
examples Version 1.0.2 2024-12-19 07:16:59 -08:00
lib/bld Bumped PMD extension to version 1.1.9 2024-12-28 17:48:30 -08:00
scripts Initial commit (split from bld-kotlin) 2024-06-15 16:36:35 -07:00
src Version 1.0.2 2024-12-19 07:16:59 -08:00
.gitignore Initial commit (split from bld-kotlin) 2024-06-15 16:36:35 -07:00
bld Initial commit (split from bld-kotlin) 2024-06-15 16:36:35 -07:00
bld.bat Initial commit (split from bld-kotlin) 2024-06-15 16:36:35 -07:00
LICENSE.txt Initial commit (split from bld-kotlin) 2024-06-15 16:36:35 -07:00
README.md Bumped bld to version 2.1.0 2024-08-30 16:29:38 -07:00

bld Extension to Generate API Documentation with Dokka for Kotlin

License Java bld Release Snapshot GitHub CI

To install, please refer to the extensions and support documentation.

Generate API Documentation

To generate a project's documentation in various formats:

@BuildCommand(value = "dokka-gfm", summary = "Generates documentation in GitHub flavored markdown format")
public void dokkaGfm() throws ExitStatusException, IOException, InterruptedException {
    new DokkaOperation()
            .fromProject(this)
            .loggingLevel(LoggingLevel.INFO)
            // Create build/dokka/gfm 
            .outputDir(Path.of(buildDirectory().getAbsolutePath(), "dokka", "gfm").toFile())
            .outputFormat(OutputFormat.MARKDOWN)
            .execute();
}

@BuildCommand(value = "dokka-html", summary = "Generates documentation in HTML format")
public void dokkaHtml() throws ExitStatusException, IOException, InterruptedException {
    new DokkaOperation()
            .fromProject(this)
            .loggingLevel(LoggingLevel.INFO)
            // Create build/dokka/html
            .outputDir(Path.of(buildDirectory().getAbsolutePath(), "dokka", "html").toFile())
            .outputFormat(OutputFormat.HTML)
            .execute();
}

@BuildCommand(value = "dokka-jekyll", summary = "Generates documentation in Jekyll flavored markdown format")
public void dokkaJekyll() throws ExitStatusException, IOException, InterruptedException {
    new DokkaOperation()
            .fromProject(this)
            .loggingLevel(LoggingLevel.INFO)
            // Create build/dokka/jekyll
            .outputDir(Path.of(buildDirectory().getAbsolutePath(), "dokka", "jekkyl").toFile())
            .outputFormat(OutputFormat.JEKYLL)
            .execute();
}

@BuildCommand(summary = "Generates Javadoc for the project")
@Override
public void javadoc() throws ExitStatusException, IOException, InterruptedException {
    new DokkaOperation()
            .fromProject(this)
            .failOnWarning(true)
            .loggingLevel(LoggingLevel.INFO)
            // Create build/javadoc
            .outputDir(new File(buildDirectory(), "javadoc"))
            .outputFormat(OutputFormat.JAVADOC)
            .execute();
}
./bld javadoc
./bld dokka-html
./bld dokka-gfm
./bld dokka-jekyll

Please check the Dokka Operation documentation for all available configuration options.

Template Project

There is also a Kotlin Template Project with support for Dokka and the Detekt extensions.