Skip to content

Commit 0f1dc64

Browse files
Developers review second round
1 parent 215eaf3 commit 0f1dc64

File tree

14 files changed

+429
-505
lines changed

14 files changed

+429
-505
lines changed

docs/dokka.tree

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version='1.0' encoding='utf-8'?>
22
<!DOCTYPE instance-profile SYSTEM "https://resources.jetbrains.com/writerside/1.0/product-profile.dtd">
3-
<instance-profile id="dokka" name="dokka" start-page="dokka-gradle-troubleshooting-md.md">
3+
<instance-profile id="dokka" name="dokka" start-page="dokka-introduction.md">
44
<snippet id="dokka">
55
<toc-element topic="dokka-introduction.md"/>
66
<toc-element topic="dokka-get-started.md"/>
@@ -13,7 +13,6 @@
1313
</toc-element>
1414
<toc-element toc-title="Output formats">
1515
<toc-element topic="dokka-html.md"/>
16-
<toc-element topic="dokka-markdown.md"/>
1716
<toc-element topic="dokka-javadoc.md"/>
1817
</toc-element>
1918
<toc-element topic="dokka-plugins.md"/>

docs/topics/dokka-get-started.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Below you can find simple instructions to help you get started with Dokka.
55
<tabs group="build-script">
66
<tab title="Gradle Kotlin DSL" group-key="kotlin">
77

8-
> This guide applies to Dokka Gradle Plugin (DGP) v2 mode. The previous DGP v1 mode is no longer supported.
8+
> This guide applies to Dokka Gradle plugin (DGP) v2 mode. The previous DGP v1 mode is no longer supported.
99
> If you're upgrading from v1 to v2 mode, see the [Migration guide](dokka-migration.md).
1010
>
1111
{style="note"}
@@ -63,20 +63,19 @@ plugins {
6363
```
6464

6565
When documenting [multi-project](https://docs.gradle.org/current/userguide/multi_project_builds.html) builds, you need
66-
to apply the Gradle plugin within subprojects as well:
66+
to [share Gradle configuration across subprojects](dokka-gradle.md#multi-project-configuration).
6767

68-
```groovy
69-
subprojects {
70-
apply plugin: 'org.jetbrains.dokka'
71-
}
72-
```
68+
To generate documentation, run the following Gradle task:
7369

74-
To generate documentation, run the following Gradle tasks:
70+
```Bash
71+
./gradlew :dokkaGenerate
72+
```
7573

76-
* `dokkaHtml` for single-project builds
77-
* `dokkaHtmlMultiModule` for multi-project builds
74+
This task works for both single and multi-project builds.
75+
You can use different tasks to generate output in [HTML](dokka-html.md),
76+
[Javadoc](dokka-javadoc.md) or both [HTML and Javadoc](dokka-gradle.md#configure-documentation-output-format).
7877

79-
By default, the output directory is set to `/build/dokka/html` and `/build/dokka/htmlMultiModule`.
78+
By default, the output directory is set to `build/dokka/html`.
8079

8180
> To learn more about using Dokka with Gradle, see [Gradle](dokka-gradle.md).
8281
>

docs/topics/dokka-introduction.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ Just like Kotlin itself, Dokka supports mixed-language projects. It understands
77
[Javadoc comments](https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html).
88

99
Dokka can generate documentation in multiple formats, including its own modern [HTML format](dokka-html.md),
10-
multiple flavors of [Markdown](dokka-markdown.md), and Java's [Javadoc HTML](dokka-javadoc.md).
10+
[GFM](https://github.com/Kotlin/dokka/blob/8e5c63d035ef44a269b8c43430f43f5c8eebfb63/dokka-subprojects/plugin-gfm/README.md) and
11+
[Jekyll](https://github.com/Kotlin/dokka/blob/8e5c63d035ef44a269b8c43430f43f5c8eebfb63/dokka-subprojects/plugin-jekyll/README.md) flavors of Markdown,
12+
and Java's [Javadoc HTML](dokka-javadoc.md).
1113

1214
Here are some libraries that use Dokka for their API reference documentation:
1315

docs/topics/dokka-migration.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Ensure that your project meets the minimum version requirements:
3838
>
3939
{style="note"}
4040

41-
Update the Dokka version to 2.0.0 in the `plugins {}` block of your project’s `build.gradle.kts` file:
41+
Update the Dokka version to %dokkaVersion% in the `plugins {}` block of your project’s `build.gradle.kts` file:
4242

4343
```kotlin
4444
plugins {
@@ -132,7 +132,7 @@ Configuration in DGP v2:
132132
The syntax of `build.gradle.kts` files differs from regular `.kt` files (such as those used for custom Gradle plugins) because Gradle's Kotlin DSL uses type-safe accessors.
133133

134134
<tabs group="dokka-configuration">
135-
<tab title="Gradle configuration file" group-key="gradle">
135+
<tab title="Gradle configuration" group-key="gradle">
136136

137137
```kotlin
138138
// build.gradle.kts
@@ -160,7 +160,7 @@ dokka {
160160
```
161161

162162
</tab>
163-
<tab title="Kotlin file" group-key="kotlin">
163+
<tab title="Kotlin custom plugin" group-key="kotlin">
164164

165165
```kotlin
166166
// CustomPlugin.kt
@@ -266,7 +266,7 @@ Configuration in DGP v2:
266266
The syntax of `build.gradle.kts` files differs from regular `.kt` files (such as those used for custom Gradle plugins) because Gradle's Kotlin DSL uses type-safe accessors.
267267

268268
<tabs group="dokka-configuration">
269-
<tab title="Gradle configuration file" group-key="gradle">
269+
<tab title="Gradle configuration" group-key="gradle">
270270

271271
```kotlin
272272
// build.gradle.kts
@@ -283,7 +283,7 @@ dokka {
283283
```
284284

285285
</tab>
286-
<tab title="Kotlin file" group-key="kotlin">
286+
<tab title="Kotlin custom plugin" group-key="kotlin">
287287

288288
```kotlin
289289
// CustomPlugin.kt
@@ -441,7 +441,7 @@ Configuration in DGP v2:
441441
The syntax of `build.gradle.kts` files differs from regular `.kt` files (such as those used for custom Gradle plugins) because Gradle's Kotlin DSL uses type-safe accessors.
442442

443443
<tabs group="dokka-configuration">
444-
<tab title="Gradle configuration file" group-key="gradle">
444+
<tab title="Gradle configuration" group-key="gradle">
445445

446446
```kotlin
447447
// build.gradle.kts
@@ -455,7 +455,7 @@ dokka {
455455
```
456456

457457
</tab>
458-
<tab title="Kotlin file" group-key="kotlin">
458+
<tab title="Kotlin custom plugin" group-key="kotlin">
459459

460460
```kotlin
461461
// CustomPlugin.kt
@@ -575,7 +575,7 @@ by creating a convention plugin in the `buildSrc` directory, and then applying t
575575
}
576576

577577
dependencies {
578-
implementation("org.jetbrains.dokka:dokka-gradle-plugin:2.0.0")
578+
implementation("org.jetbrains.dokka:dokka-gradle-plugin:%dokkaVersion%")
579579
}
580580
```
581581

@@ -723,7 +723,7 @@ to generate output in HTML, Javadoc or both HTML and Javadoc. For more informati
723723
> You may find bugs and experience migration issues when using it. Successful integration with tools that accept Javadoc
724724
> as input is not guaranteed. Use it at your own risk.
725725
>
726-
{style="note"}
726+
{style="warning"}
727727
728728
The default output format for DGP v2 is HTML. However, you can choose to generate the API documentation in HTML, Javadoc,
729729
or both formats at the same time:
@@ -789,4 +789,4 @@ DGP v2 now supports Gradle build cache and configuration cache, improving build
789789

790790
* [Explore more DGP v2 project examples](https://github.com/Kotlin/dokka/tree/master/examples/gradle-v2).
791791
* [Get started with Dokka](dokka-get-started.md).
792-
* [Learn more about Dokka plugins](dokka-plugins.md).
792+
* [Learn more about Dokka plugins](dokka-plugins.md).

docs/topics/dokka-module-and-package-docs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[//]: # (title: Subproject documentation)
1+
[//]: # (title: Module documentation)
22

33
Documentation for a subproject as a whole, as well as packages in that subproject, can be provided as separate Markdown files.
44

docs/topics/dokka-plugins.md

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[//]: # (title: Dokka plugins)
22

3-
> This guide applies to Dokka Gradle Plugin (DGP) v2 mode. The previous DGP v1 mode is no longer supported.
3+
> This guide applies to Dokka Gradle plugin (DGP) v2 mode. The previous DGP v1 mode is no longer supported.
44
> If you're upgrading from v1 to v2 mode, see the [Migration guide](dokka-migration.md).
55
>
66
{style="note"}
@@ -56,25 +56,18 @@ dependencies {
5656
</tab>
5757
<tab title="Groovy" group-key="groovy">
5858

59-
The Gradle plugin for Dokka creates convenient dependency configurations that allow you to apply Dokka plugins universally or
60-
for a specific output format only.
61-
6259
```groovy
63-
dependencies {
64-
// Is applied universally
65-
dokkaPlugin 'org.jetbrains.dokka:mathjax-plugin:%dokkaVersion%'
66-
67-
// Is applied for the single-module dokkaHtml task only
68-
dokkaHtmlPlugin 'org.jetbrains.dokka:kotlin-as-java-plugin:%dokkaVersion%'
60+
plugins {
61+
id 'org.jetbrains.dokka' version '%dokkaVersion%'
62+
}
6963
70-
// Is applied for HTML format in multi-project builds
71-
dokkaHtmlPartialPlugin 'org.jetbrains.dokka:kotlin-as-java-plugin:%dokkaVersion%'
64+
dependencies {
65+
dokkaPlugin 'org.jetbrains.dokka:mathjax-plugin'
7266
}
7367
```
7468

7569
> When documenting [multi-project](dokka-gradle.md#multi-project-configuration) builds,
76-
> you need to apply Dokka plugins within
77-
> subprojects as well as in their parent project.
70+
> you need to [share Dokka configuration across subprojects](dokka-gradle.md#multi-project-configuration).
7871
>
7972
{style="note"}
8073

@@ -164,20 +157,14 @@ Custom plugins enable additional processing or modifications to the documentatio
164157
<tab title="Groovy" group-key="groovy">
165158

166159
```groovy
167-
import org.jetbrains.dokka.gradle.DokkaTask
168-
169-
tasks.withType(DokkaTask.class) {
170-
String dokkaBaseConfiguration = """
171-
{
172-
"customAssets": ["${file("assets/my-image.png")}"],
173-
"customStyleSheets": ["${file("assets/my-styles.css")}"],
174-
"footerMessage": "(c) 2022 MyOrg"
160+
dokka {
161+
pluginsConfiguration {
162+
html {
163+
customAssets.from("logo.png")
164+
customStyleSheets.from("styles.css")
165+
footerMessage.set("(c) Your Company")
166+
}
175167
}
176-
"""
177-
pluginsMapConfiguration.set(
178-
// fully qualified plugin name to json configuration
179-
["org.jetbrains.dokka.base.DokkaBase": dokkaBaseConfiguration]
180-
)
181168
}
182169
```
183170

@@ -251,6 +238,8 @@ Here are some notable Dokka plugins that you might find useful:
251238
| [MermaidJS HTML plugin](https://github.com/glureau/dokka-mermaid) | Renders [MermaidJS](https://mermaid-js.github.io/mermaid/#/) diagrams and visualizations found in KDocs |
252239
| [Mathjax HTML plugin](https://github.com/Kotlin/dokka/tree/%dokkaVersion%/dokka-subprojects/plugin-mathjax) | Pretty prints mathematics found in KDocs |
253240
| [Kotlin as Java plugin](https://github.com/Kotlin/dokka/tree/%dokkaVersion%/dokka-subprojects/plugin-kotlin-as-java) | Renders Kotlin signatures as seen from Java's perspective |
241+
| [GFM plugin](https://github.com/Kotlin/dokka/tree/master/dokka-subprojects/plugin-gfm) | Adds the ability to generate documentation in GitHub Flavoured Markdown format |
242+
| [Jekyll plugin](https://github.com/Kotlin/dokka/tree/master/dokka-subprojects/plugin-jekyll) | Adds the ability to generate documentation in Jekyll Flavoured Markdown format |
254243

255244
If you are a Dokka plugin author and would like to add your plugin to this list, get in touch with maintainers
256245
via [Slack](dokka-introduction.md#community) or [GitHub](https://github.com/Kotlin/dokka/).

docs/topics/formats/dokka-html.md

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[//]: # (title: HTML)
22

3-
> This guide applies to Dokka Gradle Plugin (DGP) v2 mode. The previous DGP v1 mode is no longer supported.
3+
> This guide applies to Dokka Gradle plugin (DGP) v2 mode. The previous DGP v1 mode is no longer supported.
44
> If you're upgrading from v1 to v2 mode, see the [Migration guide](dokka-migration.md).
55
>
66
{style="note"}
@@ -67,23 +67,19 @@ dokka {
6767
<tab title="Groovy" group-key="groovy">
6868

6969
```groovy
70-
import org.jetbrains.dokka.gradle.DokkaTask
70+
// build.gradle
7171
72-
tasks.withType(DokkaTask.class) {
73-
String dokkaBaseConfiguration = """
74-
{
75-
"customAssets": ["${file("assets/my-image.png")}"],
76-
"customStyleSheets": ["${file("assets/my-styles.css")}"],
77-
"footerMessage": "(c) 2022 MyOrg"
78-
"separateInheritedMembers": false,
79-
"templatesDir": "${file("dokka/templates")}",
80-
"mergeImplicitExpectActualDeclarations": false
72+
dokka {
73+
pluginsConfiguration {
74+
html {
75+
customAssets.from("logo.png")
76+
customStyleSheets.from("styles.css")
77+
footerMessage.set("(c) Your Company")
78+
separateInheritedMembers.set(false)
79+
templatesDir.set(file("dokka/templates"))
80+
mergeImplicitExpectActualDeclarations.set(false)
81+
}
8182
}
82-
"""
83-
pluginsMapConfiguration.set(
84-
// fully qualified plugin name to json configuration
85-
["org.jetbrains.dokka.base.DokkaBase": dokkaBaseConfiguration]
86-
)
8783
}
8884
```
8985

docs/topics/formats/dokka-javadoc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[//]: # (title: Javadoc)
22
<primary-label ref="alpha"/>
33

4-
> This guide applies to Dokka Gradle Plugin (DGP) v2 mode. The previous DGP v1 mode is no longer supported.
4+
> This guide applies to Dokka Gradle plugin (DGP) v2 mode. The previous DGP v1 mode is no longer supported.
55
> If you're upgrading from v1 to v2 mode, see the [Migration guide](dokka-migration.md).
66
>
77
{style="note"}

0 commit comments

Comments
 (0)