aboutsummaryrefslogtreecommitdiff
path: root/dokka-runners/dokkatoo/examples/library-publishing-example/dokka/README.md
blob: 60d967b8f5fa796d563854e131f71364a9794f9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Dokka Library publishing example

This example demonstrates how you can integrate Dokka into the publishing process of your library, adding
documentation generated by Dokka as artifacts.

This is useful because some repositories, like Maven Central, require documentation (`javadoc.jar`) to be published
alongside library artifacts.

You can also use services like [javadoc.io](https://javadoc.io/) to host of your library's API documentation for free 
and without any additional setup - it will take documentation pages straight from the published artifact. It works with 
both HTML and Javadoc formats as demonstrated by 
[com.trib3's Javadocs](https://javadoc.io/doc/com.trib3/server/latest/index.html).

## Running

Run `dokkaHtml` task to generate documentation for this example:

```bash
./gradlew dokkaHtml
```

### Javadoc jar

Run `dokkaJavadocJar` task to create a jar file that contains documentation generated in Dokka's Javadoc format.

```Bash
./gradlew dokkaJavadocJar
```

After that, you can find the jar under `build/libs/dokka-library-publishing-example-javadoc.jar`

### HTML jar


Run `dokkaHtmlJar` task to create a jar file that contains documentation generated in Dokka's HTML format.

```Bash
./gradlew dokkaHtmlJar
```

After that, you can find the jar under `build/libs/dokka-library-publishing-example-html.jar`