bld Extension to Generate API Documentation with Dokka for Kotlin
https://github.com/rife2/bld-dokka
Bumped JUnit version to 5.11.3 Bumped PMD extension version to 1.1.7 Bumped JDK to version 23 (GitHub CI Workflow) Bumped Kotlin to version 2.0.21 Bumped Kotlin extension to version 1.0.2 |
||
---|---|---|
.github/workflows | ||
.idea | ||
.vscode | ||
config | ||
examples | ||
lib/bld | ||
scripts | ||
src | ||
.gitignore | ||
bld | ||
bld.bat | ||
LICENSE.txt | ||
README.md |
bld Extension to Generate API Documentation with Dokka for Kotlin
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.