Dokka plugin to provide the documentation model to AsciiDoxy

Overview

Dokka plugin template

This repository provides a template for creating Dokka plugins (check the Creating a repository from a template article).

TL;DR: Click the Use this template button and clone it in IntelliJ IDEA.

Getting started

Before writing a plugin it might be beneficial to spend 5 minutes reading our developer guide to have a basic idea about the data model and system architecture. If some you miss some information or something is unclear please let us know on community slack or via github issue.

Structure

A minimal repository for a Dokka plugin should contain files in the following structure:

.
├── LICENSE
├── README.md
├── build.gradle.kts
├── gradle
│   └── wrapper
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── settings.gradle.kts
└── src
    └── main
        ├── kotlin
        │   └── template
        │       └── MyAwesomeDokkaPlugin.kt
        └── resources
            └── META-INF
                └── services
                    └── org.jetbrains.dokka.plugability.DokkaPlugin

Applying the plugin

In order to apply a plugin it needs to be published to a repository. For development use we recommend the mavenLocal. This repository contains a basic setup for publishing artefacts to that repository. In order to do it use publishToMavenLocal task.

After that you will need a sample project to test on. Kotlin has a lot of sample projects to choose from eg: dokka-gradle-example

In order to apply the plugin you need to add it to project dependencies:

dependencies {
    dokkaPlugin("template:template-dokka-plugin:0.1")
}

Please keep in mind, that you need to have a mavenLocal() repository in your project.

After that you can run Dokka on this project and see the results. You should use a Dokka command you desire to write a plugin for (eg. dokkaHtml, dokkaGfm or other) with --info logging level. In project logs you should see the name of a plugin:

...
Initializing plugins
Loaded plugins: [org.jetbrains.dokka.base.DokkaBase, template.MyAwesomeDokkaPlugin]
Loaded: [
...

Testing

This project includes a test dependency on dokka-test-api and dokka-base-test-utils that allows for easy testing. We highly encourage for you to extend tests classes with BaseAbstractTest() which allows you to write kotlin or java code in your tests without a need to provide external files. This way the tests are much cleaner and easier to reason about.

This repository contains most basic example of a test using this mechanism.

Debugging

Sometimes things don't work as we expected :)

From our experience using debugger is the most efficient. Apart from debugging tests you are able to debug whole projects while Dokka is running. Enable the debugger in the project you wish to generate documentation for using org.gradle.debug = true and, in intellij with your plugin, run the remote configuration.

For more information please visit official intellij guide

Publishing

Publishing locally

In order to test your plugin locally, please use the publishToMavenLocal task, as explained in the Applying the plugin section.

Publishing to Maven Central

Publishing extension has been preconfigured for deployment to Maven Central repository via OSSRH. A jar file with documentation (javadoc.jar) is created with Dokka. In order to sigh the publication, you have to provide one of the following sets of environmental variables:

    • SIGN_KEY_ID - The public key ID (The last 8 symbols of the keyId)
    • SIGN_KEY - The secret (private) key
    • SIGN_KEY_PASSPHRASE - The passphrase used to protect your private key
    • SIGN_KEY - The secret (private) key
    • SIGN_KEY_PASSPHRASE - The passphrase used to protect your private key

For more information about signing the publication, please refer to the Signing Plugin readme.

OSSRH credentials also have to be provided via

  • SONATYPE_USER
  • SONATYPE_PASSWORD

environmental variables.

Please follow the OSSRH guide for the detailed steps on how to get the credentials and claim the group name.

Finally, the publication can be started with ./gradlew publish command

Final words

After creating a plugin please consider sharing it with the community on official Dokka plugins list

You might also like...
Kotlin Native Xcode Plugin
Kotlin Native Xcode Plugin

Kotlin Native Xcode Support Plugin to facilitate debugging iOS applications using Kotlin Native in Xcode. Defines Kotlin files as source code, with ba

Gradle plugin for simplify Kotlin Multiplatform mobile configurations
Gradle plugin for simplify Kotlin Multiplatform mobile configurations

Mobile Multiplatform gradle plugin This is a Gradle plugin for simple setup of Kotlin Multiplatform mobile Gradle modules. Setup buildSrc/build.gradle

VirtualTag is a name tag edit plugin for minecraft server

VirtualTag VirtualTag is a NameTag Edit plugin for modern minecraft server Support Version 1.17.x Download https://github.com/jiangdashao/VirtualTag/r

A Kotlin compiler plugin that allows Java callers to pass in null for default parameters

kotlin-null-defaults (Compiler plugin) (Gradle Plugin) ( Currently pending approval) A Kotlin compiler plugin that allows Java callers to pass in null

An open-source plugin that accommodates Starships on Minecraft servers.

Minecraft Starship Plugin An open-source plugin that accommodates starships on minecraft servers. 'A shameless rip-off of Star Legacy's plugins.' Mine

An annotation and Kotlin compiler plugin for enforcing a when statement is exhaustive

An annotation and Kotlin compiler plugin for enforcing a when statement is exhaustive

A composite Github Action to execute the Kotlin Script with compiler plugin and dependency caching!

Kotlin Script Github Action Kotlin can also be used as a scripting language, which is more safer, concise, and fun to write than bash or python. Githu

use kmm to write a flutter plugin
use kmm to write a flutter plugin

use KMM to write a flutter plugin The reference plugin_codelab example plugin that accompanies the How to write a Flutter plugin codelab. I changed pl

A plugin for Termux to use native Android GUI components from CLI applications.

Termux:GUI This is a plugin for Termux that enables command line programs to use the native android GUI. In the examples directory you can find demo v

Owner
Rob van der Most
Rob van der Most
Arrow Endpoint offers a composable Endpoint datatype, that allows us easily define an Endpoint from which we can derive clients, servers & documentation.

Arrow Endpoint Arrow Endpoint offers a composable Endpoint datatype, that allows us easily define an Endpoint from which we can derive clients, server

ΛRROW 8 Oct 11, 2021
A fork of our clean architecture boilerplate using the Model-View-Intent pattern

Android Clean Architecture MVI Boilerplate Note: This is a fork of our original Clean Architecture Boilerplate, except in this repo we have switched o

Buffer 974 Dec 29, 2022
This server uses json files to model items, entities and more.

Design Server | Simple server to design items, entities or more About this project/server: This server uses json files to model items, entities and mo

Phillipp Glanz 5 Jan 7, 2022
Android Library that provide simpler way to achieve modularity

ToyBricks 中文文档 ToyBricks简介以及原理分析 ToyBricks用户手册 Introduction Android Library that provide simpler way to achieve modularity. Compile System requirement

null 33 Nov 14, 2022
A pair of applications provide a direct means of integrating with one another via application programming interfaces (APIs)

What is a native integration? It's when a pair of applications provide a direct means of integrating with one another via application programming interfaces (APIs). Once integrated, data can flow between the apps and become more readily available to your employees.

Behruz Hurramov 2 Jan 17, 2022
Plugin-shared-preferences - Pluto plugin to manage your Shared Preferences

Pluto Shared Preferences Plugin Pluto Shared Preferences is a Pluto plugin to in

Pluto 1 Feb 14, 2022
💫 A Gradle Plugin to generate your networking code from Swagger

Swagger Gradle Codegen A Gradle plugin to generate networking code from a Swagger spec file. This plugin wraps swagger-codegen, and exposes a configur

Yelp.com 399 Nov 28, 2022
Gradle plugin adding a task to run a Paper Minecraft server

Run Paper Run Paper is a Gradle plugin which adds a task to automatically download and run a Paper Minecraft server along with your plugin built by Gr

Jason 64 Dec 29, 2022
Spigot-Plugin message providing system written in Kotlin

teller Spigot-Plugin message providing system written in Kotlin Usage Create an instance of PropertiesMessageProvider using the Constructor with an in

Luca Zieserl 2 Jan 16, 2022
An under development minecraft plugin (1.8.8) to learning Kotlin language

CorePlus CorePlus is a minecraft plugin coded with Kotlin language. Still under development CorePlus will be an essential for each minecraft servers !

Gonz 3 Jun 16, 2021