diff --git a/docs/README.md b/docs/README.md index 52e982d7c2b..0683b807482 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,30 +1,36 @@ -# docs +# Dokka documentation -This module contains documentation for Dokka that is deployed to [kotlinlang.org](https://kotlinlang.org/) +This folder contains the Dokka documentation that is available on [kotlinlang.org](https://kotlinlang.org/). -Documentation format is basically markdown with some DSL that is used internally at JetBrains. +Our documentation is written in Markdown format with some domain specific language (DSL) that is used at JetBrains. ## Project structure -* `dokka.tree` represents Table of Contents -* `vars.list` contains variables that you can use throughout documentation -* `topics` directory contains documentation topics themselves +This project contains: +* A `topics` directory, which contains our documentation in Markdown format. +* A `dokka.tree` file, that describes the site navigation structure. +* A `vars.list` file, that contains a list of variables that you can use throughout documentation. -## DSL +## DSL guide + +This section explains what DSL you can use to create different document elements. ### Title -Each page must have a title. By default, this title is used in ToC as well. +To declare the title of your document: ```text [//]: # (title: Name of topic) ``` -Note that title is basically a level 1 header, and it has to be the only one. So all other headers within topics must -be at least level 2, otherwise sidebar navigation may not work as expected. +Every document must have a title. By default, this title is used in the side menu. + +As the title is a level 1 header, it must be the only level 1 header in your document. All other headers within your document must be at least level 2, otherwise the side menu may not work as expected. ### Notes +To add a note: + ```text > This is a simple note > @@ -33,6 +39,8 @@ be at least level 2, otherwise sidebar navigation may not work as expected. ### Tips +To add a tip: + ```text > This is a useful tip > @@ -41,6 +49,8 @@ be at least level 2, otherwise sidebar navigation may not work as expected. ### Warning +To add a warning: + ```text > This is a warning > @@ -49,9 +59,9 @@ be at least level 2, otherwise sidebar navigation may not work as expected. ### Tabs -Tabs can be used to give instructions that are specific to a build system or something else. +Tabs can be used to save space in your document, allowing you to show different text in the same space depending on the tab chosen. -Content inside tabs is not limited to just text - it can be code blocks, tips, etc. +Content within tabs isn't limited to text. You can also add code blocks, tips, etc. ```text @@ -75,9 +85,7 @@ Instructions specific to CLI ``` -Notice the use of `group-key` - this groups all tabs on the page, and when the user switches to a tab - it switches to -all tabs with this key throughout the whole page. This is convenient for the user, since if they switched to Groovy tab, -they probably want other tabs to be of that value as well. +You can use the `group-key` parameter to link tabs in a document together. Grouping tabs like this means that if your reader selects a particular tab, e.g. "Groovy", then other tabbed sections in your document will also show the tab for "Groovy" first. ## Documentation preview diff --git a/docs/topics/formats/html.md b/docs/topics/formats/html.md index 2d0c6f6774a..4b1e1d8a264 100644 --- a/docs/topics/formats/html.md +++ b/docs/topics/formats/html.md @@ -1,15 +1,14 @@ [//]: # (title: HTML) -HTML is Dokka's default and recommended format. You can see it in action by browsing documentation +HTML is Dokka's default and recommended output format. You can see an example of the final result by browsing documentation for [kotlinx.coroutines](https://kotlinlang.org/api/kotlinx.coroutines/). ## Generating HTML documentation -This format comes standard in all runners: - +HTML as an output format is supported by all runners. To generate HTML documentation, follow these steps depending on your runner: * For [Gradle](gradle.md#generating-documentation), run `dokkaHtml` or `dokkaHtmlMultiModule` tasks. -* For [Maven](maven.md#generating-documentation), run `dokka:dokka` goal. -* For [CLI runner](cli.md), run it with [HTML dependencies](cli.md#generating-documentation). +* For [Maven](maven.md#generating-documentation), run the `dokka:dokka` goal. +* For [CLI runner](cli.md#generating-documentation), run with HTML dependencies set. > HTML pages generated by this format require a web server in order to render everything correctly. > @@ -161,47 +160,48 @@ Via [JSON configuration](cli.md#running-with-json-configuration): -For more details, see [configuring Dokka plugins](plugins_introduction.md#configuring-dokka-plugins) topic. - ### Configuration options -| **Option** | **Description** | -|-----------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `customAssets` | List of paths for image assets to be bundled with documentation. Can have any extension. See [modifying assets](#customizing-assets) section for details. | -| `customStyleSheets` | List of paths for `.css` stylesheets to be bundled with documentation and used for rendering. See [modifying styles](#customizing-styles) section for details. | -| `footerMessage` | Text displayed in the footer. | -| `separateInheritedMembers` | Boolean property. If set to `true`, Dokka will render properties/functions and inherited properties/inherited functions separately. Disabled by default. | -| `templatesDir` | Path to the directory with custom HTML templates. See [templates](#templates) section for more details. | -| `mergeImplicitExpectActualDeclarations` | Boolean property. If set to true, Dokka will merge declarations that are not declared as [expect/actual](https://kotlinlang.org/docs/multiplatform-connect-to-apis.html), but have the same fully qualified name. Can be useful in legacy codebases. Disabled by default. | +The table below contains all of the possible configuration options and their purpose. + +| **Option** | **Description** | +|-----------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `customAssets` | List of paths for image assets to be bundled with documentation. The image assets can have any file extension. For more information, see [Customizing assets](#customizing-assets). | +| `customStyleSheets` | List of paths for `.css` stylesheets to be bundled with documentation and used for rendering. For more information, see [Customizing styles](#customizing-styles). | +| `templatesDir` | Path to the directory containing custom HTML templates. For more information, see [Templates](#templates). | +| `footerMessage` | The text displayed in the footer. | +| `separateInheritedMembers` | This is a boolean property. If set to `true`, Dokka renders properties/functions and inherited properties/inherited functions separately. This is disabled by default. | +| `mergeImplicitExpectActualDeclarations` | This is a boolean property. If set to true, Dokka merges declarations that are not declared as [expect/actual](https://kotlinlang.org/docs/multiplatform-connect-to-apis.html), but have the same fully qualified name. This can be useful for legacy codebases. This is disabled by default. | +For more information about configuring Dokka plugins, see [Configuring Dokka plugins](plugins_introduction.md#configuring-dokka-plugins). ## Customization -HTML format provides a number of customization options. +To help you add your own look and feel to your documentation, the HTML format supports a number of customization options. ### Customizing styles -You can provide your own stylesheets by setting `customStyleSheets` -[configuration property](#configuration). These files will be applied to every page. +You can use your own stylesheets by using the `customStyleSheets` +[configuration option](#configuration). These are applied to every page. -Files with the same name will be overwritten, so it is possible to override stylesheets that Dokka uses: +It's also possible to override Dokka's stylesheets by using files with the same name: -| **Stylesheet name** | **Description** | -|----------------------|---------------------------------------------------------------| -| `style.css` | Main stylesheet, contains most styles used across all pages | -| `logo-styles.css` | Header logo styling | -| `prism.css` | Styles for [PrismJS](https://prismjs.com/) syntax highlighter | -| `jetbrains-mono.css` | Font styling | +| **Stylesheet name** | **Description** | +|----------------------|--------------------------------------------------------------------| +| `style.css` | Main stylesheet, contains most of the styles used across all pages | +| `logo-styles.css` | Header logo styling | +| `prism.css` | Styles for [PrismJS](https://prismjs.com/) syntax highlighter | +| `jetbrains-mono.css` | Font styling | -Source code for all of the used styles is +The source code for all of Dokka's stylesheets is [available on GitHub](https://github.com/Kotlin/dokka/tree/%dokkaVersion%/plugins/base/src/main/resources/dokka/styles). ### Customizing assets -You can provide your own images to be bundled with documentation by setting `customAssets` -[configuration property](#configuration). These files will be copied to `/images` directory. +You can provide your own images to be bundled with documentation by using the `customAssets` +[configuration option](#configuration). These files are copied to the `/images` directory. -Files with the same name will be overwritten, so it is possible to override images and icons that Dokka uses. The most +It's possible to override Dokka's images and icons by using files with the same name. The most useful and relevant one being `logo-icon.svg`, which is the image that's used in the header. The rest is mostly icons. You can find all images used by Dokka on @@ -209,18 +209,17 @@ You can find all images used by Dokka on ### Changing the logo -To customize the logo, you can begin by [providing your own asset](#customizing-assets) for `logo-icon.svg`. If your -image has similar size, it should not look out of place. +To customize the logo, you can begin by [providing your own asset](#customizing-assets) for `logo-icon.svg`. For the best results, use an image of a similar size. -However, if your image has different dimensions or you want to use a `.png` image instead of the default `.svg` file, -you can [override `logo-styles.css` stylesheet](#customizing-styles) and make it fit. +However, if your image has different dimensions or you want to use a `.png` file instead of the default `.svg` file, +you can [override the `logo-styles.css` stylesheet](#customizing-styles) to make it fit. -For an example of how to do it, see +For an example of how to do this, see our [custom format example project](https://github.com/Kotlin/dokka/tree/%dokkaVersion%/examples/gradle/dokka-customFormat-example). -### Modifying footer +### Modifying the footer -You can modify the footer message by setting `footerMessage` [configuration property](#configuration). +You can modify text in the footer by using the `footerMessage` [configuration option](#configuration). ### Templates @@ -231,35 +230,35 @@ You can change the header completely, add your own banners/menus/search, load an Dokka uses the following templates: -| **Template** | **Description** | -|-----------------------------------|-------------------------------------------------------------------------------------------------------------------| -| `base.ftl` | Defines general design of all pages to be rendered. | -| `includes/header.ft` | Page header that by default contains the logo, version, source set selector, light/dark theme switch and search. | -| `includes/footer.ft` | Page footer that contains `footerMessage` [configuration property](#configuration) and copyright. | -| `includes/page_metadata.ft` | Metadata used within `` container. | -| `includes/source_set_selector.ft` | [Source set](https://kotlinlang.org/docs/multiplatform-discover-project.html#source-sets) selector in the header. | +| **Template** | **Description** | +|-----------------------------------|-----------------------------------------------------------------------------------------------------------------------| +| `base.ftl` | Defines the general design of all pages to be rendered. | +| `includes/header.ft` | The page header that by default contains the logo, version, source set selector, light/dark theme switch, and search. | +| `includes/footer.ft` | The page footer that contains the `footerMessage` [configuration option](#configuration) and copyright. | +| `includes/page_metadata.ft` | Metadata used within `` container. | +| `includes/source_set_selector.ft` | [The source set](https://kotlinlang.org/docs/multiplatform-discover-project.html#source-sets) selector in the header. | -`base.ftl` template is the base template and it includes all the other ones. You can find source code for all templates +The base template is `base.ftl` and it includes all of the remaining listed templates. You can find the source code for all of Dokka's templates [on GitHub](https://github.com/Kotlin/dokka/tree/%dokkaVersion%/plugins/base/src/main/resources/dokka/templates). -You can override any template by setting `templatesDir` [configuration property](#configuration). Dokka will look -for the exact template names within given directory. If it fails to find user-defined templates, it will use the -default ones. +You can override any template by using the `templatesDir` [configuration option](#configuration). Dokka searches +for the exact template names within the given directory. If it fails to find user-defined templates, it uses the +default templates. #### Variables -Following variables are available inside all templates: +The following variables are available inside all templates: -| **Variable** | **Description** | -|--------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `${pageName}` | Page name | -| `${footerMessage}` | Text which is set by the `footerMessage` [configuration property](#configuration) | -| `${sourceSets}` | Nullable list of [source sets](https://kotlinlang.org/docs/multiplatform-discover-project.html#source-sets) for multi-platform pages. Each item has `name`, `platform` and `filter` properties. | -| `${projectName}` | Project name. Available only within `template_cmd` directive. | -| `${pathToRoot}` | Path to root from current page. Useful for locating assets. Available only within `template_cmd` directive. | +| **Variable** | **Description** | +|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `${pageName}` | The page name | +| `${footerMessage}` | The text which is set by the `footerMessage` [configuration option](#configuration) | +| `${sourceSets}` | A nullable list of [source sets](https://kotlinlang.org/docs/multiplatform-discover-project.html#source-sets) for multi-platform pages. Each item has `name`, `platform`, and `filter` properties. | +| `${projectName}` | The project name. It's available only within the `template_cmd` directive. | +| `${pathToRoot}` | The path to root from the current page. It's useful for locating assets and is available only within the `template_cmd` directive. | -Variables `projectName` and `pathToRoot` are available only within `@template_cmd` directive as they require more -context and thus need to be resolved at later stages by the [MultiModule](gradle.md#multi-project-builds) task: +Variables `projectName` and `pathToRoot` are available only within the `template_cmd` directive as they require more +context and thus they need to be resolved at later stages by the [MultiModule](gradle.md#multi-project-builds) task: ```html <@template_cmd name="projectName"> @@ -271,9 +270,9 @@ context and thus need to be resolved at later stages by the [MultiModule](gradle You can also use the following Dokka-defined [directives](https://freemarker.apache.org/docs/ref_directive_userDefined.html): -| **Variable** | **Description** | -|-----------------|----------------------------------------------------------------------------------------------------------------------------------------| -| `<@content/>` | Main page content. | -| `<@resources/>` | Resources such as scripts and stylesheets. | -| `<@version/>` | Module version taken from configuration. If [versioning plugin](versioning.md) is applied, it will be replaced with version navigator. | +| **Variable** | **Description** | +|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------| +| `<@content/>` | The main page content. | +| `<@resources/>` | Resources such as scripts and stylesheets. | +| `<@version/>` | The module version taken from configuration. If the [versioning plugin](versioning.md) is applied, it is replaced with a version navigator. | diff --git a/docs/topics/formats/javadoc.md b/docs/topics/formats/javadoc.md index a319d38a5dd..d85cb680abf 100644 --- a/docs/topics/formats/javadoc.md +++ b/docs/topics/formats/javadoc.md @@ -1,49 +1,49 @@ [//]: # (title: Javadoc) -> Javadoc output format is still in Alpha, use at your own risk, expect bugs and migration issues. Correct -> integration with tools that accept Java's Javadoc HTML as input is not guaranteed. +> The Javadoc output format is still in Alpha so you may find bugs and experience migration issues when using it. **You use it at your own risk.** +> Successful integration with tools that accept Java's Javadoc HTML as input is not guaranteed. > {type="warning"} -Dokka's Javadoc output format is a lookalike of Java's +Dokka's Javadoc output format is similar to Java's [Javadoc HTML format](https://docs.oracle.com/en/java/javase/19/docs/api/index.html). -It tries to visually mimic HTML pages generated by the Javadoc tool, but it's not a direct implementation -and it's not an exact copy. +It tries to visually mimic HTML pages generated by the Javadoc tool, but it's not a direct implementation +or an exact copy. ![Screenshot of javadoc output format](javadoc-format-example.png){height=750} -All Kotlin code and signatures are rendered as seen from Java's perspective, this is achieved with +All Kotlin code and signatures are rendered as seen from Java's perspective. This is achieved with our [Kotlin as Java plugin](https://github.com/Kotlin/dokka/tree/master/plugins/kotlin-as-java), which comes bundled and applied by default for this format. -Javadoc output format is a rendering [Dokka plugin](plugins_introduction.md), maintained by the Dokka team. -It is [open source](https://github.com/Kotlin/dokka/tree/master/plugins/javadoc). +The Javadoc output format is generated by our [Dokka plugin](plugins_introduction.md), which we actively maintain. +It is open source and you can find the source code on [GitHub](https://github.com/Kotlin/dokka/tree/master/plugins/javadoc). -## Geneatring Javadoc documentation +## Generating Javadoc documentation -> Javadoc format does not support multiplatform projects. +> The Javadoc format is not supported for multiplatform projects. > -{type="note"} +{type="warning"} -Dokka's [Gradle plugin](gradle.md) ships with Javadoc format included, you can use the following tasks: +Dokka's [Gradle plugin](gradle.md) comes with the Javadoc output format included. You can use the following tasks: -| **Task** | **Description** | -|-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `dokkaJavadoc` | Generates Javadoc documentation for a single project. | -| `dokkaJavadocCollector` | A [Collector](gradle.md#collector-tasks) task created only for parent projects in multi-project builds. Calls `dokkaJavadoc` for every subproject and merges all outputs into a single virtual project. | +| **Task** | **Description** | +|-------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `dokkaJavadoc` | Generates Javadoc documentation for a single project. | +| `dokkaJavadocCollector` | A [Collector](gradle.md#collector-tasks) task created only for parent projects in multi-project builds. It calls `dokkaJavadoc` for every subproject and merges all outputs into a single virtual project. | -`javadoc.jar` [can be built separately](gradle.md#building-javadoc-jar). +The `javadoc.jar` file can be generated separately. For more information, see [Building `javadoc.jar`](gradle.md#building-javadoc-jar). -Dokka's [Maven plugin](maven.md) ships with Javadoc format built in, you can generate documentation -with the following goals: +Dokka's [Maven plugin](maven.md) comes with the Javadoc output format built in. You can generate documentation +by using the following goals: | **Goal** | **Description** | |--------------------|------------------------------------------------------------------------------| @@ -54,10 +54,10 @@ with the following goals: -Since Javadoc format is a [Dokka plugin](plugins_introduction.md#applying-dokka-plugins), you need to download the -[jar file](https://mvnrepository.com/artifact/org.jetbrains.dokka/javadoc-plugin/%dokkaVersion%). +Since the Javadoc output format is generated by a [Dokka plugin](plugins_introduction.md#applying-dokka-plugins), you need to download the plugin as a +[JAR file](https://mvnrepository.com/artifact/org.jetbrains.dokka/javadoc-plugin/%dokkaVersion%). -Javadoc format has two dependencies that you will need to provide as jar files as well: +The Javadoc output format has two dependencies that you need to provide as additional JAR files: * [kotlin-as-java plugin](https://mvnrepository.com/artifact/org.jetbrains.dokka/kotlin-as-java-plugin/%dokkaVersion%) * [korte-jvm](https://mvnrepository.com/artifact/com.soywiz.korlibs.korte/korte-jvm/3.3.0) @@ -86,7 +86,7 @@ Via [JSON configuration](cli.md#running-with-json-configuration): } ``` -For more information, see [other output formats](cli.md#other-output-formats) section for the CLI runner. +For more information, see [Other output formats](cli.md#other-output-formats) in the CLI runner documentation. diff --git a/docs/topics/formats/markdown.md b/docs/topics/formats/markdown.md index 42ed18cf644..690cfbb1566 100644 --- a/docs/topics/formats/markdown.md +++ b/docs/topics/formats/markdown.md @@ -1,6 +1,6 @@ [//]: # (title: Markdown) -> Markdown output formats are still in Alpha, use at your own risk, expect bugs and migration issues. +> The Markdown output formats are still in Alpha so you may find bugs and experience migration issues when using them. **You use them at your own risk.** > {type="warning"} @@ -15,18 +15,18 @@ they are open source. ## GFM -GFM format generates documentation in [GitHub Flavored Markdown](https://github.github.com/gfm/). +The GFM output format generates documentation in [GitHub Flavored Markdown](https://github.github.com/gfm/). -Dokka's [Gradle plugin](gradle.md) ships with GFM format included, you can use the following tasks: +Dokka's [Gradle plugin](gradle.md) comes with the GFM output format included. You can use the following tasks with it: -| **Task** | **Description** | -|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `dokkaGfm` | Generates GFM documentation for a single project. | -| `dokkaGfmMultiModule` | A [MultiModule](gradle.md#multi-project-builds) task created only for parent projects in multi-project builds. Generates documentation for subprojects and collects all outputs in a single place with a common table of contents. | -| `dokkaGfmCollector` | A [Collector](gradle.md#collector-tasks) task created only for parent projects in multi-project builds. Calls `dokkaGfm` for every subproject and merges all outputs into a single virtual project. | +| **Task** | **Description** | +|-----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `dokkaGfm` | Generates GFM documentation for a single project. | +| `dokkaGfmMultiModule` | A [MultiModule](gradle.md#multi-project-builds) task created only for parent projects in multi-project builds. It generates documentation for subprojects and collects all outputs in a single place with a common table of contents. | +| `dokkaGfmCollector` | A [Collector](gradle.md#collector-tasks) task created only for parent projects in multi-project builds. It calls `dokkaGfm` for every subproject and merges all outputs into a single virtual project. | @@ -51,9 +51,9 @@ dependency: ``` -After that, running `dokka:dokka` goal should produce documentation in GFM format. +After configuring this, running the `dokka:dokka` goal produces documentation in GFM format. -For more information, see [other output formats](maven.md#other-output-formats) section for the Maven plugin. +For more information, see the Mavin plugin documentation for [Other output formats](maven.md#other-output-formats). @@ -84,27 +84,27 @@ Via [JSON configuration](cli.md#running-with-json-configuration): } ``` -For more information, see [other output formats](cli.md#other-output-formats) section for the CLI runner. +For more information, see the CLI runner documentation for [Other output formats](cli.md#other-output-formats). -You can find sources [on GitHub](https://github.com/Kotlin/dokka/tree/%dokkaVersion%/plugins/gfm). +You can find the source code [on GitHub](https://github.com/Kotlin/dokka/tree/%dokkaVersion%/plugins/gfm). ## Jekyll -Jekyll format generates documentation in [Jekyll](https://jekyllrb.com/) compatible Markdown. +The Jekyll output format generates documentation in [Jekyll](https://jekyllrb.com/) compatible Markdown. -Dokka's [Gradle plugin](gradle.md) ships with Jekyll format included, you can use the following tasks: +Dokka's [Gradle plugin](gradle.md) comes with the Jekyll output format included. You can use the following tasks with it: -| **Task** | **Description** | -|--------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `dokkaJekyll` | Generates Jekyll documentation for a single project. | -| `dokkaJekyllMultiModule` | A [MultiModule](gradle.md#multi-project-builds) task created only for parent projects in multi-project builds. Generates documentation for subprojects and collects all outputs in a single place with a common table of contents. | -| `dokkaJekyllCollector` | A [Collector](gradle.md#collector-tasks) task created only for parent projects in multi-project builds. Calls `dokkaJekyll` for every subproject and merges all outputs into a single virtual project. | +| **Task** | **Description** | +|--------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `dokkaJekyll` | Generates Jekyll documentation for a single project. | +| `dokkaJekyllMultiModule` | A [MultiModule](gradle.md#multi-project-builds) task created only for parent projects in multi-project builds. It generates documentation for subprojects and collects all outputs in a single place with a common table of contents. | +| `dokkaJekyllCollector` | A [Collector](gradle.md#collector-tasks) task created only for parent projects in multi-project builds. It calls `dokkaJekyll` for every subproject and merges all outputs into a single virtual project. | @@ -129,9 +129,9 @@ dependency: ``` -After that, running `dokka:dokka` goal should produce documentation in GFM format. +After configuring this, running the `dokka:dokka` goal produces documentation in GFM format. -For more information, see [other output formats](maven.md#other-output-formats) section for the Maven plugin. +For more information, see the Maven plugin documentation for [Other output formats](maven.md#other-output-formats). @@ -164,9 +164,9 @@ Via [JSON configuration](cli.md#running-with-json-configuration): } ``` -For more information, see [other output formats](cli.md#other-output-formats) section for the CLI runner. +For more information, see the CLI runner documentation for [Other output formats](cli.md#other-output-formats). -You can find sources [on GitHub](https://github.com/Kotlin/dokka/tree/%dokkaVersion%/plugins/jekyll). +You can find the source code on [GitHub](https://github.com/Kotlin/dokka/tree/%dokkaVersion%/plugins/jekyll). diff --git a/docs/topics/overview.md b/docs/topics/overview.md index f88a9d884aa..8321fe20286 100644 --- a/docs/topics/overview.md +++ b/docs/topics/overview.md @@ -2,14 +2,14 @@ Dokka is an API documentation engine for Kotlin. -Just like Kotlin itself, Dokka supports mixed-language projects: it understands Kotlin's +Just like Kotlin itself, Dokka supports mixed-language projects. It understands Kotlin's [KDoc comments](https://kotlinlang.org/docs/kotlin-doc.html#kdoc-syntax) and Java's [Javadoc comments](https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html). -Dokka can generate documentation in multiple formats, including its own and modern [HTML format](html.md), -multiple flavours of [Markdown](markdown.md) and Java's [Javadoc HTML](javadoc.md). +Dokka can generate documentation in multiple formats, including its own modern [HTML format](html.md), +multiple flavors of [Markdown](markdown.md), and Java's [Javadoc HTML](javadoc.md). -Libraries that use Dokka for API reference docs: +There are already a number of libraries that use Dokka for their API reference documentation: * [kotlinx.coroutines](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/) * [Bitmovin](https://cdn.bitmovin.com/player/android/3/docs/index.html) @@ -17,7 +17,7 @@ Libraries that use Dokka for API reference docs: * [Ktor](https://api.ktor.io/) * [OkHttp](https://square.github.io/okhttp/4.x/okhttp/okhttp3/) (Markdown) -Dokka can be run via [Gradle](gradle.md), [Maven](maven.md) or [command line](cli.md). It is also +Dokka can be run via [Gradle](gradle.md), [Maven](maven.md) or on the [command line](cli.md). It is also [highly pluggable](plugins_introduction.md). ## Quickstart @@ -25,7 +25,7 @@ Dokka can be run via [Gradle](gradle.md), [Maven](maven.md) or [command line](cl -Apply Dokka Gradle plugin in the root project: +Apply the Dokka Gradle plugin in the root of your project: ```kotlin plugins { @@ -33,7 +33,7 @@ plugins { } ``` -When documenting [multi-project](gradle.md#multi-project-builds) builds, you need to apply Dokka in subprojects as well: +When documenting [multi-project](gradle.md#multi-project-builds) builds, you need to apply the Dokka plugin within subprojects as well: ```kotlin subprojects { @@ -41,19 +41,19 @@ subprojects { } ``` -To generate documentation run the following Gradle tasks: +To generate documentation, run the following Gradle tasks: -* `dokkaHtml` for single-project builds. -* `dokkaHtmlMultiModule` for multi-module builds. +* `dokkaHtml` for single-project builds +* `dokkaHtmlMultiModule` for multi-module builds -By default, output directory is set to `/build/dokka/html` and `/build/dokka/htmlMultiModule`. +By default, the output directory is set to `/build/dokka/html` and `/build/dokka/htmlMultiModule`. -Learn more about Gradle configuration in a separate [topic dedicated to Gradle](gradle.md). +To learn more about Gradle configuration, see [Gradle](gradle.md). -Apply Dokka Gradle plugin in the root project: +Apply the Dokka Gradle plugin in the root of your project: ```groovy plugins { @@ -61,7 +61,7 @@ plugins { } ``` -When documenting [multi-project](gradle.md#multi-project-builds) builds, you need to apply Dokka in subprojects as well: +When documenting [multi-project](gradle.md#multi-project-builds) builds, you need to apply the Dokka plugin within subprojects as well: ```groovy subprojects { @@ -69,19 +69,19 @@ subprojects { } ``` -To generate documentation run the following Gradle tasks: +To generate documentation, run the following Gradle tasks: -* `dokkaHtml` for single-project builds. -* `dokkaHtmlMultiModule` for multi-module builds. +* `dokkaHtml` for single-project builds +* `dokkaHtmlMultiModule` for multi-module builds By default, output directory is set to `/build/dokka/html` and `/build/dokka/htmlMultiModule`. -Learn more about Gradle configuration in a separate [topic dedicated to Gradle](gradle.md). +To learn more about Gradle configuration, see [Gradle](gradle.md). -Add Dokka Maven plugin to the plugins section of your POM: +Add the Dokka Maven plugin to the plugins section of your POM file: ```xml @@ -103,11 +103,11 @@ Add Dokka Maven plugin to the plugins section of your POM: ``` -To generate documentation run `dokka:dokka` goal. +To generate documentation, run the `dokka:dokka` goal. -By default, output directory is set to `target/dokka`. +By default, the output directory is set to `target/dokka`. -Learn more about Maven configuration in a separate [topic dedicated to Maven](maven.md). +To learn more about Maven configuration, see [Maven](maven.md). @@ -115,4 +115,4 @@ Learn more about Maven configuration in a separate [topic dedicated to Maven](ma ## Community Dokka has a dedicated `#dokka` channel in [Kotlin Community Slack](https://surveys.jetbrains.com/s3/kotlin-slack-sign-up) -where you can chat about Dokka itself, its plugins and how to develop them, and get in touch with maintainers. +where you can chat about Dokka, its plugins and how to develop them, as well as get in touch with maintainers. diff --git a/docs/topics/plugins/plugins_introduction.md b/docs/topics/plugins/plugins_introduction.md index 3b162e0c3e3..bee4c027292 100644 --- a/docs/topics/plugins/plugins_introduction.md +++ b/docs/topics/plugins/plugins_introduction.md @@ -14,13 +14,13 @@ If you want to learn how to create Dokka plugins, see ## Applying Dokka plugins Dokka plugins are published as separate artifacts, so to apply a Dokka plugin you only need to add it as a dependency. -From there, the plugin will extend Dokka by itself - no extra actions needed. +From there, the plugin extends Dokka by itself - no further action is needed. > Plugins that use the same extension points or work in a similar way can interfere with each other. > This may lead to visual bugs, general undefined behaviour or even failed builds. However, it should not lead to > concurrency issues since Dokka does not expose any mutable data structures or objects. -> -> If you notice any problems of such nature, it's a good idea to check which plugins are applied and what they do. +> +> If you notice problems like this, it's a good idea to check which plugins are applied and what they do. > {type="note"} @@ -30,23 +30,23 @@ to your project: -Gradle plugin creates convenient dependency configurations that allow you to apply plugins universally or +The Gradle plugin creates convenient dependency configurations that allow you to apply plugins universally or for a specific output format only. ```kotlin dependencies { - // will be applied universally + // Is applied universally dokkaPlugin("org.jetbrains.dokka:mathjax-plugin:%dokkaVersion%") - - // will be applied for single-module dokkaHtml task only + + // Is applied for the single-module dokkaHtml task only dokkaHtmlPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:%dokkaVersion%") - // will be applied for html format in multi-project builds + // Is applied for HTML format in multi-project builds dokkaHtmlPartialPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:%dokkaVersion%") } ``` -> When documenting [multi-project](gradle.md#multi-project-builds) builds, you need to apply Dokka plugins in +> When documenting [multi-project](gradle.md#multi-project-builds) builds, you need to apply Dokka plugins within > subprojects as well as in their parent project. > {type="note"} @@ -54,23 +54,23 @@ dependencies { -Gradle plugin creates convenient dependency configurations that allow you to apply Dokka plugins universally or +The Gradle plugin creates convenient dependency configurations that allow you to apply Dokka plugins universally or for a specific output format only. ```groovy dependencies { - // will be applied universally + // Is applied universally dokkaPlugin 'org.jetbrains.dokka:mathjax-plugin:%dokkaVersion%' - // will be applied for single-module dokkaHtml task only + // Is applied for the single-module dokkaHtml task only dokkaHtmlPlugin 'org.jetbrains.dokka:kotlin-as-java-plugin:%dokkaVersion%' - // will be applied for html format in multi-project builds + // Is applied for HTML format in multi-project builds dokkaHtmlPartialPlugin 'org.jetbrains.dokka:kotlin-as-java-plugin:%dokkaVersion%' } ``` -> When documenting [multi-project](gradle.md#multi-project-builds) builds, you need to apply Dokka plugins in +> When documenting [multi-project](gradle.md#multi-project-builds) builds, you need to apply Dokka plugins within > subprojects as well as in their parent project. > {type="note"} @@ -127,18 +127,18 @@ If you are using [JSON configuration](cli.md#running-with-json-configuration), D ## Configuring Dokka plugins -Dokka plugins can also have configuration options of their own. Consult used plugin's documentation to see which +Dokka plugins can also have configuration options of their own. Consult each plugin's documentation to see which options are available. -Let's have a look at how you can configure `DokkaBase` plugin, which is responsible for generating [HTML](html.md) -documentation, by adding a custom image to assets (`customAssets` option), by adding custom style sheets -(`customStyleSheets` option) and by modifying the footer message (`footerMessage` option): +Let's have a look at how you can configure the `DokkaBase` plugin, which is responsible for generating [HTML](html.md) +documentation, by adding a custom image to assets (`customAssets` option), by adding custom style sheets +(`customStyleSheets` option), and by modifying the footer message (`footerMessage` option): Gradle's Kotlin DSL allows for type-safe plugin configuration. This is achievable by adding plugin's artifact to classpath -dependencies in `buildscript` block, and then importing plugin and configuration classes: +dependencies in the `buildscript` block, and then importing plugin and configuration classes: ```kotlin import org.jetbrains.dokka.base.DokkaBase @@ -160,7 +160,7 @@ tasks.withType().configureEach { } ``` -Alternatively, plugins can be configured via JSON. This way no additional dependencies are needed. +Alternatively, plugins can be configured via JSON. With this method, no additional dependencies are needed. ```kotlin import org.jetbrains.dokka.gradle.DokkaTask @@ -233,7 +233,7 @@ tasks.withType(DokkaTask.class) { If you are using the [CLI](cli.md) runner with [command line arguments](cli.md#running-with-command-line-arguments), -use `-pluginsConfiguration` argument that accepts JSON configuration in the form of `fullyQualifiedPluginName=json`. +use the `-pluginsConfiguration` argument that accepts JSON configuration in the form of `fullyQualifiedPluginName=json`. If you need to configure multiple plugins, you can pass multiple values separated by `^^`. @@ -243,8 +243,8 @@ java -jar dokka-cli-%dokkaVersion%.jar \ -pluginsConfiguration "org.jetbrains.dokka.base.DokkaBase={\"customAssets\": [\"my-image.png\"], \"customStyleSheets\": [\"my-styles.css\"], \"footerMessage\": \"(c) 2022 MyOrg CLI\"}" ``` -If you are using [JSON configuration](cli.md#running-with-json-configuration), there exists a similar -`pluginsConfiguration` array that accepts JSON as values. +If you are using [JSON configuration](cli.md#running-with-json-configuration), there exists a similar +`pluginsConfiguration` array that accepts JSON as `values`. ```json { @@ -264,10 +264,12 @@ If you are using [JSON configuration](cli.md#running-with-json-configuration), t ## Notable plugins -| **Name** | **Description** | -|-----------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------| -| [Android documentation plugin](https://github.com/Kotlin/dokka/tree/master/plugins/android-documentation) | Improves documentation experience on Android platform | -| [Versioning plugin](versioning.md) | Adds version selector and helps organize documentation for different version of your application/library | -| [MermaidJS HTML plugin](https://github.com/glureau/dokka-mermaid) | Renders [MermaidJS](https://mermaid-js.github.io/mermaid/#/) diagrams and visualizations found in KDocs | -| [Mathjax HTML plugin](https://github.com/Kotlin/dokka/tree/master/plugins/mathjax) | Pretty prints mathematics found in KDocs | -| [Kotlin as Java plugin](https://github.com/Kotlin/dokka/tree/master/plugins/kotlin-as-java) | Renders Kotlin signatures as seen from Java's perspective | +For a list of popular Dokka plugins, see the table below. + +| **Name** | **Description** | +|-----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------| +| [Android documentation plugin](https://github.com/Kotlin/dokka/tree/master/plugins/android-documentation) | Improves the documentation experience on Android | +| [Versioning plugin](versioning.md) | Adds version selector and helps to organize documentation for different versions of your application/library | +| [MermaidJS HTML plugin](https://github.com/glureau/dokka-mermaid) | Renders [MermaidJS](https://mermaid-js.github.io/mermaid/#/) diagrams and visualizations found in KDocs | +| [Mathjax HTML plugin](https://github.com/Kotlin/dokka/tree/master/plugins/mathjax) | Pretty prints mathematics found in KDocs | +| [Kotlin as Java plugin](https://github.com/Kotlin/dokka/tree/master/plugins/kotlin-as-java) | Renders Kotlin signatures as seen from Java's perspective | diff --git a/docs/topics/plugins/versioning.md b/docs/topics/plugins/versioning.md index 9cdbeebfb3f..f0d4be0a7d8 100644 --- a/docs/topics/plugins/versioning.md +++ b/docs/topics/plugins/versioning.md @@ -1,16 +1,16 @@ [//]: # (title: Versioning plugin) -Versioning plugin aims to provide the ability to host documentation for multiple versions of your library/application -with seamless switching between them. This, in turn, provides better experience for your users. +The versioning plugin provides the ability to host documentation for multiple versions of your library/application +with seamless switching between them. This, in turn, provides a better experience for your users. ![Screenshot of documentation version dropdown](versioning-plugin-example.png){height=350} -> Versioning plugin only works with [HTML](html.md) format. +> The versioning plugin only works with [HTML](html.md) format. > {type="note"} -Visit [versioning plugin example project](https://github.com/Kotlin/dokka/tree/1.7.20/examples/gradle/dokka-versioning-multimodule-example) -to see it in action as well as how it can be configured. +Visit the [versioning plugin example project](https://github.com/Kotlin/dokka/tree/1.7.20/examples/gradle/dokka-versioning-multimodule-example) +to see an example of it in action and how it can be configured. ## Applying the plugin @@ -25,7 +25,7 @@ dependencies { } ``` -> When documenting [multi-project](gradle.md#multi-project-builds) builds, you need to apply versioning plugin in +> When documenting [multi-project](gradle.md#multi-project-builds) builds, you need to apply the versioning plugin within > subprojects as well as in their parent project. > {type="note"} @@ -39,7 +39,7 @@ dependencies { } ``` -> When documenting [multi-project](gradle.md#multi-project-builds) builds, you need to apply versioning plugin in +> When documenting [multi-project](gradle.md#multi-project-builds) builds, you need to apply the versioning plugin within > subprojects as well as in their parent project. > {type="note"} @@ -67,10 +67,10 @@ dependencies { -You can find versioning plugin's artifact on +You can find the versioning plugin's artifact on [mvnrepository](https://mvnrepository.com/artifact/org.jetbrains.dokka/versioning-plugin/%dokkaVersion%) or by browsing -[maven central repository](https://repo1.maven.org/maven2/org/jetbrains/dokka/versioning-plugin/%dokkaVersion%/) -directly, and pass it to `pliginsClasspath`. +[maven central repository](https://repo1.maven.org/maven2/org/jetbrains/dokka/versioning-plugin/%dokkaVersion%/) +directly, and pass it to `pluginsClasspath`. Via [command line arguments](cli.md#running-with-command-line-arguments): @@ -101,19 +101,19 @@ Via [JSON configuration](cli.md#running-with-json-configuration): ### Configuration options -Versioning plugin has a number of optional configuration properties: +The table below contains all the possible configuration options for the versioning plugin and their purpose. -| **Property** | **Description** | -|--------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `version` | Version of your application/library for which documentation is going to be generated. This will be the version in the dropdown menu. | -| `versionsOrdering` | Optional list of strings that represents the order in which versions should appear in the dropdown menu. Must match versions string exactly. First item of the list is the topmost in the dropdown. | -| `olderVersionsDir` | Optional path to a parent folder that contains other documentation versions. Requires a certain [directory structure](#directory-structure). | -| `olderVersions` | Optional list of paths to other documentation versions. Must point to Dokka's outputs directly. Useful if different versions are scattered and cannot be put into a single directory. | -| `renderVersionsNavigationOnAllPages` | Optional boolean indicating whether to render navigation dropdown on all pages. True by default. | +| **Option** | **Description** | +|--------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `version` | The version of your application/library that documentation is going to be generated for. This will be the version shown in the dropdown menu. | +| `versionsOrdering` | An optional list of strings that represents the order that versions should appear in the dropdown menu. Must match versions string exactly. The first item in the list is at the top of the dropdown. | +| `olderVersionsDir` | An optional path to a parent folder that contains other documentation versions. It requires a specific directory structure. For more information, see [Directory structure](#directory-structure). | +| `olderVersions` | An optional list of paths to other documentation versions. It must point to Dokka's outputs directly. This is useful if different versions can't all be in the same directory. | +| `renderVersionsNavigationOnAllPages` | An optional boolean value indicating whether to render the navigation dropdown on all pages. Set to true by default. | #### Directory structure -Note that the directory passed to `olderVersionsDir` requires a specific structure: +Note that the directory passed to `olderVersionsDir` needs to follow a specific structure: ```text . @@ -253,31 +253,30 @@ Alternatively, via JSON configuration: ## Generating versioned documentation -With versioning plugin applied and configured, no other steps are needed: documentation can be built the usual way. +With the versioning plugin applied and configured, no other steps are needed. Documentation can be built in the usual way. -Among other things, versioning plugin will add a `version.json` file to the output folder. This file will be used by the +Among other things, the versioning plugin adds a `version.json` file to the output folder. This file is used by the plugin to match versions and generate version navigation. If your previously generated documentation does not have that -file, you will need to re-generate documentation for such versions -- adding just the file will not work. +file, you will need to re-generate documentation for such versions. Just adding the file will not work. -Versioning plugin will also bundle all other documentation versions that have been passed through `olderVersionsDir` -and `olderVersions` configuration properties by putting them inside `older` directory. +The versioning plugin also bundles all other documentation versions that have been passed through `olderVersionsDir` +and `olderVersions` configuration options by putting them inside the `older` directory. ## Usage example -There is no single correct way to configure the plugin, it can be tailored to your liking and needs. However, +There is no single correct way to configure the plugin, it can be tailored to your needs. However, it can be a bit overwhelming when starting out. Below you will find one of the ways it can be configured so that you -can begin publishing versioned documentation right away. +can begin publishing versioned documentation straight away. The main idea behind it is the following: -1. One directory will contain all versions of your documentation. For instance, `documentation/version/{doc_version}`. - This is your archive, you will need to preserve it for future builds. -2. Output directory of all new builds will be set to that directory as well, under `documentation/version/{new_version}` -3. When new builds are executed, the plugin will look for previous versions of documentation in the archive directory. -4. Once new documentation has been generated, it needs to be **copied** to some place accessible by the user: - GitHub pages, nginx static directories, and so on. It needs to be copied and not moved because Dokka will still need - this version for future builds, otherwise there will be a gap in the archive. -5. Once it has been safely copied away, you can remove `older` directory from the newly generated and archived version. +1. One directory contains all versions of your documentation. For example, `documentation/version/{doc_version}`. + This is your archive which is needed for future builds. +2. The output directory of all new builds is set to that directory as well, under `documentation/version/{new_version}`. +3. When new builds are executed, the plugin looks for previous versions of documentation in the archive directory. +4. Once new documentation has been generated, it needs to be **copied** to somewhere accessible by the user. + For example, GitHub pages or nginx static directories. It needs to be **copied**, not moved, because Dokka needs +5. Once it has been safely copied, you can remove the `older` directory from the newly generated and archived version. This helps reduce the overhead of each version bundling all previous versions, as these files are effectively duplicates. ```kotlin @@ -295,15 +294,15 @@ dependencies { } tasks.dokkaHtml { - // can be any persistent folder where + // This can be any persistent folder where // you store documentation by version val docVersionsDir = projectDir.resolve("documentation/version") - // version for which you are currently generating docs + // The version for which you are currently generating docs val currentVersion = "1.3" - // set output to folder with all other versions - // as you'll need current version for future builds + // Set the output to a folder with all other versions + // as you'll need the current version for future builds val currentDocsDir = docVersionsDir.resolve(currentVersion) outputDirectory.set(currentDocsDir) @@ -313,15 +312,15 @@ tasks.dokkaHtml { } doLast { - // this folder will contain latest documentation with all + // This folder contains the latest documentation with all // previous versions included, so it's ready to be published. - // make sure it's copied and not moved - you'll still need this + // Make sure it's copied and not moved - you'll still need this // version for future builds currentDocsDir.copyTo(file("/my/hosting")) - // only once current documentation has been safely moved, + // Only once current documentation has been safely moved, // remove previous versions bundled in it. They will not - // be needed in future builds, it's just overhead + // be needed in future builds, it's just overhead. currentDocsDir.resolve("older").deleteRecursively() } } diff --git a/docs/topics/runners/cli.md b/docs/topics/runners/cli.md index 59999ee34fd..cb7c72ca9d2 100644 --- a/docs/topics/runners/cli.md +++ b/docs/topics/runners/cli.md @@ -1,18 +1,18 @@ [//]: # (title: CLI runner) If for some reason you cannot use [Gradle](gradle.md) or [Maven](maven.md) plugins, Dokka has -a command line runner for generating documentation without any build tools. +a command line (CLI) runner for generating documentation without any build tools. -In comparison, it has the same, if not more, capabilities as the Gradle plugin, although it is considerably more +In comparison, it has the same, if not more, capabilities as the Gradle plugin. Although it is considerably more difficult to set up as there is no autoconfiguration, especially in multiplatform and multimodule environments. -CLI runner is published as a separate artifact to Maven Central under `org.jetbrains.dokka:dokka-cli`, so you can +The CLI runner is published as a separate artifact to Maven Central under `org.jetbrains.dokka:dokka-cli`, so you can find it on [mvnrepository](https://mvnrepository.com/artifact/org.jetbrains.dokka/dokka-cli) or by browsing [maven central repository directories](https://repo1.maven.org/maven2/org/jetbrains/dokka/dokka-cli/) directly. ## Getting started -With `dokka-cli-%dokkaVersion%.jar` file on your computer, you can run it with `-help` to see available arguments and their description: +With the `dokka-cli-%dokkaVersion%.jar` file saved on your computer, run it with the `-help` option to see all available arguments and their description: ```Bash java -jar dokka-cli-%dokkaVersion%.jar -help @@ -26,11 +26,11 @@ java -jar dokka-cli-%dokkaVersion%.jar -sourceSet -help ## Generating documentation -### Pre-requisites +### Prerequisites -Since there is no build tool to manage dependencies, you will have to provide dependency `.jar` files yourself. +Since there is no build tool to manage dependencies, you have to provide dependency `.jar` files yourself. -Dependencies you will need for any format: +Listed below are the dependencies that you need for any output format: | **Group** | **Artifact** | **Version** | **Link** | |-----------------------|----------------------------|----------------|-----------------------------------------------------------------------------------------------------------------| @@ -39,7 +39,7 @@ Dependencies you will need for any format: | `org.jetbrains.dokka` | `kotlin-analysis-compiler` | %dokkaVersion% | [mvnrepository](https://mvnrepository.com/artifact/org.jetbrains.dokka/kotlin-analysis-compiler/%dokkaVersion%) | | `org.jetbrains.dokka` | `kotlin-analysis-intellij` | %dokkaVersion% | [mvnrepository](https://mvnrepository.com/artifact/org.jetbrains.dokka/kotlin-analysis-intellij/%dokkaVersion%) | -Additional dependencies for [HTML](html.md) format: +Below are the additional dependencies that you need for [HTML](html.md) output format: | **Group** | **Artifact** | **Version** | **Link** | |-------------------------|--------------------|-------------|--------------------------------------------------------------------------------------------------| @@ -51,10 +51,10 @@ Additional dependencies for [HTML](html.md) format: You can pass command line arguments to configure the CLI runner. -At the very least you would need to provide the following arguments: +At the very least you need to provide the following arguments: * `-pluginsClasspath` - a list of absolute/relative paths to downloaded dependencies, separated by semi-colons `;` -* `-sourceSet` - an absolute path to code sources for which to generate documentation -* `-outputDir` - an absolute/relative path of documentation output directory +* `-sourceSet` - an absolute path to code sources to generate documentation for +* `-outputDir` - an absolute/relative path of the documentation output directory ```Bash java -jar dokka-cli-%dokkaVersion%.jar \ @@ -63,25 +63,25 @@ java -jar dokka-cli-%dokkaVersion%.jar \ -outputDir "./dokka/html" ``` -> Due to an internal class conflict, first pass `kotlin-analysis-intellij` and only then `kotlin-analysis-compiler`, -> otherwise it can lead to obscure exceptions such as `NoSuchFieldError`. +> Due to an internal class conflict, first pass `kotlin-analysis-intellij` and only then `kotlin-analysis-compiler`. +> Otherwise you may see obscure exceptions, such as `NoSuchFieldError`. > {type="note"} -Executing the given example should generate documentation in [HTML](html.md) format. +Executing the given example generates documentation in [HTML](html.md) output format. -See [command line arguments](#command-line-arguments) for more configuration details. +See [Command line arguments](#command-line-arguments) for more configuration details. ### Running with JSON configuration -It is possible to configure the CLI runner with JSON. In this case, you will need to provide an -absolute/relative path to the JSON configuration file, and all other configuration options will be parsed from it. +It's possible to configure the CLI runner with JSON. In this case, you need to provide an +absolute/relative path to the JSON configuration file. All other configuration options are parsed from it. ```Bash java -jar dokka-cli-%dokkaVersion%.jar dokka-configuration.json ``` -At the very least, you would need the following configuration: +At the very least, you need the following configuration: ```json { "outputDir": "./dokka/html", @@ -107,8 +107,8 @@ At the very least, you would need the following configuration: } ``` -> Due to an internal class conflict, first pass `kotlin-analysis-intellij` and only then `kotlin-analysis-compiler`, -> otherwise it can lead to obscure exceptions such as `NoSuchFieldError`. +> Due to an internal class conflict, first pass `kotlin-analysis-intellij` and only then `kotlin-analysis-compiler`. +> Otherwise you may see obscure exceptions, such as `NoSuchFieldError`. > {type="note"} @@ -116,14 +116,14 @@ See [JSON configuration options](#json-configuration) for more details. ### Other output formats -By default, `dokka-base` artifact contains stable [HTML](html.md) format only. +By default, the `dokka-base` artifact contains the [HTML](html.md) output format only. -All other output formats come as [Dokka plugins](plugins_introduction.md). In order to use them, you have to put it -on plugins classpath. +All other output formats come as part of [Dokka plugins](plugins_introduction.md). In order to use them, you have to put them +in the plugins classpath. -For example, if you want to generate documentation in experimental [GFM](markdown.md#gfm) format, you have to download and -pass [gfm-plugin's jar](https://mvnrepository.com/artifact/org.jetbrains.dokka/gfm-plugin/%dokkaVersion%) into -`pluginsClasspath` configuration option. +For example, if you want to generate documentation in the experimental [GFM](markdown.md#gfm) output format, you need to download and +pass [gfm-plugin's JAR](https://mvnrepository.com/artifact/org.jetbrains.dokka/gfm-plugin/%dokkaVersion%) into +the `pluginsClasspath` configuration option. Via command line arguments: @@ -147,14 +147,14 @@ Via JSON configuration: } ``` -With GFM plugin on classpath, CLI runner should generate documentation in GFM format, no extra actions -needed. +With the GFM plugin in the `pluginsClasspath`, the CLI runner generates documentation in GFM output format. +No further action is needed. -For more information, see [Markdown](markdown.md) and [Javadoc](javadoc.md#geneatring-javadoc-documentation) topics. +For more information, see [Markdown](markdown.md) and [Javadoc](javadoc.md#generating-javadoc-documentation). ## Command line arguments -You can see short descriptions for command line arguments by running: +To see a list of all possible command line arguments for the nested `-sourceSet` configuration, run: ```Bash java -jar dokka-cli-%dokkaVersion%.jar -help @@ -230,8 +230,8 @@ Summary: ## JSON configuration -Below you will find examples and detailed descriptions for each configuration section. You can also find an example -with [all configuration options](#complete-configuration) applied at once at the very bottom. +Below are some examples and detailed descriptions for each configuration section. You can also find an example +with [all configuration options](#complete-configuration) applied. ### General configuration @@ -272,24 +272,24 @@ with [all configuration options](#complete-configuration) applied at once at the -

Display name used to refer to the module. Used for ToC, navigation, logging, etc.

-

Default is root.

+

The display name used to refer to the module. Used in the table of contents, navigation, logging, etc.

+

Default: root.

Module version.

-

Default is empty.

+

Default: empty.

-

Directory to which documentation will be generated, regardless of format.

-

Default is ./dokka

+

The directory to where documentation is generated, regardless of output format.

+

Default: ./dokka

- Whether to fail documentation generation if Dokka has emitted a warning or an error. - Will wait until all errors and warnings have been emitted first. + Whether to fail documentation generation if Dokka emits a warning or an error. + The process waits until all errors and warnings have been emitted first.

This setting works well with reportUndocumented

-

Default is false.

+

Default: false.

Whether to suppress obvious functions.

@@ -306,42 +306,44 @@ with [all configuration options](#complete-configuration) applied at once at the

-

Default is true.

+

Default: true.

Whether to suppress inherited members that aren't explicitly overridden in a given class.

- Note: this can suppress functions such as equals / hashCode / toString, + Note: this can suppress functions such as equals / hashCode / +toString, but cannot suppress synthetic functions such as dataClass.componentN and dataClass.copy. Use suppressObviousFunctions for that.

-

Default is false.

+

Default: false.

Whether to resolve remote files/links over network.

- This includes package-lists used for generating external documentation links: - for instance, to make classes from standard library clickable. + This includes package-lists used for generating external documentation links. + For example, to make classes from standard library clickable.

Setting this to true can significantly speed up build times in certain cases, - but can also worsen documentation quality and user experience, for instance by + but can also worsen documentation quality and user experience. For example, by not resolving some dependency's class/member links.

Note: you can cache fetched files locally and provide them to Dokka as local paths. See externalDocumentationLinks.

-

Default is false.

+

Default: false.

- List of Markdown files that contain + A list of Markdown files that contain module and package documentation.

-

Contents of specified files will be parsed and embedded into documentation as module and package descriptions.

-

Can be configured on per-package basis.

+

The contents of specified files are parsed and embedded into documentation as module and package +descriptions.

+

This can be configured on per-package basis.

@@ -351,26 +353,26 @@ with [all configuration options](#complete-configuration) applied at once at the

For a list of possible options, see source set configuration.

-

Global configuration of source links that will be applied for all source sets.

+

The global configuration of source links that are applied for all source sets.

For a list of possible options, see source link configuration.

-

Global configuration of matched packages, regardless of the source set they are in.

+

The global configuration of matched packages, regardless of the source set they are in.

For a list of possible options, see per-package configuration.

-

Global configuration of external documentation links, regardless of the source set they are used in.

+

The global configuration of external documentation links, regardless of the source set they are used in.

For a list of possible options, see external documentation configuration.

-

List of jars with Dokka plugins and their dependencies.

+

A list of JAR files with Dokka plugins and their dependencies.

### Source set configuration -Configuration of Kotlin -[source sets](https://kotlinlang.org/docs/multiplatform-discover-project.html#source-sets). +How to configure Kotlin +[source sets](https://kotlinlang.org/docs/multiplatform-discover-project.html#source-sets): ```json { @@ -429,23 +431,23 @@ Configuration of Kotlin -

Display name used to refer to the source set.

+

The display name used to refer to the source set.

- The name will be used both externally (for example, as source set name visible to documentation readers) and + The name is used both externally (for example, the source set name is visible to documentation readers) and internally (for example, for logging messages of reportUndocumented).

-

Platform name could be used if you don't have a better alternative.

+

The platform name can be used if you don't have a better alternative.

-

Technical ID of the source set

+

The technical ID of the source set

-

Set of visibility modifiers that should be documented.

+

The set of visibility modifiers that should be documented.

This can be used if you want to document protected/internal/private declarations, as well as if you want to exclude public declarations and only document internal API.

-

Can be configured on per-package basis.

+

This can be configured on per-package basis.

Possible values: @@ -456,15 +458,15 @@ Configuration of Kotlin

  • PACKAGE
  • -

    Default is PUBLIC.

    +

    Default: PUBLIC.

    Whether to emit warnings about visible undocumented declarations, that is declarations without KDocs after they have been filtered by documentedVisibilities.

    -

    This setting works well with failOnWarning. Can be overridden for a specific package

    -

    Default is false.

    +

    This setting works well with failOnWarning. It can be overridden for a specific package

    +

    Default: false.

    @@ -472,34 +474,34 @@ Configuration of Kotlin various filters have been applied.

    - For instance, if skipDeprecated is set to true and your package contains only - deprecated declarations, it will be considered to be empty. + For example, if skipDeprecated is set to true and your package contains only + deprecated declarations, it is considered to be empty.

    Default for CLI runner is false.

    Whether to document declarations annotated with @Deprecated.

    -

    Can be overridden on package level.

    -

    Default is false.

    +

    It can be overridden at package level.

    +

    Default: false.

    -

    JDK version to use when generating external documentation links for Java types.

    +

    The JDK version to use when generating external documentation links for Java types.

    - For instance, if you use java.util.UUID from JDK in some public declaration signature, - and this property is set to 8, Dokka will generate an external documentation link + For example, if you use java.util.UUID from JDK in some public declaration signature, + and this property is set to 8, Dokka generates an external documentation link to JDK 8 Javadocs for it.

    - Kotlin language version + The Kotlin language version used for setting up analysis and @sample environment.

    - Kotlin API version + The Kotlin API version used for setting up analysis and @sample environment.

    @@ -509,19 +511,21 @@ Configuration of Kotlin Whether to generate external documentation links that lead to API reference documentation for Kotlin's standard library when declarations from it are used.

    -

    Default is false, meaning links will be generated.

    +

    Links are generated when `noStdLibLink` is set to false.

    +

    Default: false.

    Whether to generate external documentation links to JDK's Javadocs when declarations from it are used.

    +

    Links are generated when `noJdkLink` is set to false.

    The version of JDK Javadocs is determined by jdkVersion property.

    -

    Default is false, meaning links will be generated.

    +

    Default: false.

    - List of Markdown files that contain + A list of Markdown files that contain module and package documentation.

    -

    Contents of specified files will be parsed and embedded into documentation as module and package descriptions.

    +

    The contents of the specified files are parsed and embedded into documentation as module and package descriptions.

    @@ -541,51 +545,51 @@ Configuration of Kotlin

    - Source code roots to be analyzed and documented. - Accepts directories and individual .kt / .java files. + The source code roots to be analyzed and documented. + It accepts directories and individual .kt / .java files.

    - Classpath for analysis and interactive samples. If you use a declaration from a dependency, + The classpath for analysis and interactive samples. If you use a declaration from a dependency, it should be present on the classpath to be resolved.

    Property accepts both .jar and .klib files.

    - List of directories or files that contain sample functions which are referenced via + A list of directories or files that contain sample functions which are referenced via @sample KDoc tag.

    -

    Files to be suppressed when generating documentation.

    +

    The files to be suppressed when generating documentation.

    -

    Configuration of source links that will be applied only for this source set.

    +

    A set of parameters for source links that are applied only for this source set.

    For a list of possible options, see source link configuration.

    -

    Configuration specific to matched packages within this source set.

    +

    A set of parameters specific to matched packages within this source set.

    For a list of possible options, see per-package configuration.

    -

    Configuration of external documentation links that will be applied only for this source set.

    +

    A set of parameters for external documentation links that are applied only for this source set.

    For a list of possible options, see external documentation configuration.

    ### Source link configuration -Configuration block that allows adding a `source` link to each signature -which leads to `remoteUrl` with a specific line number (configurable by setting `remoteLineSuffix`), -letting documentation readers find source code for each declaration. +The `sourceLinks` configuration block is where you can add a `source` link to each signature +that leads to a `remoteUrl` with a specific line number. (The line number is configurable by setting `remoteLineSuffix`). +This helps readers to find the source code for each declaration. -For an example, see documentation for -[count](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/count.html) -function from `kotlinx.coroutines`. +For an example, see the documentation for the +[`count()`](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/count.html) +function in `kotlinx.coroutines`. -Configurable for all source sets at once, or [for each source set individually](#source-set-configuration) +You can configure source sets together at the same time, or [individually](#source-set-configuration): ```json { @@ -605,20 +609,20 @@ Configurable for all source sets at once, or [for each source set individually](

    - URL of source code hosting service that can be accessed by documentation readers, - like GitHub, GitLab, Bitbucket, etc. This URL will be used to generate + The URL of the source code hosting service that can be accessed by documentation readers, + like GitHub, GitLab, Bitbucket, etc. This URL is used to generate source code links of declarations.

    - Suffix used to append source code line number to the URL. This will help readers navigate + The suffix used to append source code line number to the URL. This helps readers navigate not only to the file, but to the specific line number of the declaration.

    - The number itself will be appended to the specified suffix. For instance, - if this property is set to #L and the line number is 10, resulting URL suffix - will be #L10. + The number itself is appended to the specified suffix. For example, + if this property is set to #L and the line number is 10, the resulting URL suffix + is #L10.

    Suffixes used by popular services: @@ -628,15 +632,15 @@ Configurable for all source sets at once, or [for each source set individually](

  • Bitbucket: #lines-
  • -

    Default is empty (no suffix).

    +

    Default: empty (no suffix).

    ### Per-package configuration -Configuration block that allows setting some options for specific packages matched by `matchingRegex`. +The `perPackageOptions` configuration block allows you to set some options for specific packages matched by `matchingRegex`. -Configurable for all source sets at once, or [for each source set individually](#source-set-configuration) +You can configure source sets together at the same time, or [individually](#source-set-configuration): ```json { @@ -654,16 +658,16 @@ Configurable for all source sets at once, or [for each source set individually]( -

    Regular expression that is used to match the package.

    +

    The regular expression that is used to match the package.

    Whether this package should be skipped when generating documentation.

    -

    Default is false.

    +

    Default: false.

    Whether to document declarations annotated with @Deprecated.

    -

    Can be set on project/module level.

    -

    Default is false.

    +

    This can be set on project/module level.

    +

    Default: false.

    @@ -671,31 +675,31 @@ Configurable for all source sets at once, or [for each source set individually]( this package and without KDocs, after they have been filtered by documentedVisibilities.

    This setting works well with failOnWarning.

    -

    Can be configured on source set level.

    -

    Default is false.

    +

    This can be configured on source set level.

    +

    Default: false.

    -

    Set of visibility modifiers that should be documented.

    +

    The set of visibility modifiers that should be documented.

    This can be used if you want to document protected/internal/private declarations within a specific package, as well as if you want to exclude public declarations and only document internal API.

    Can be configured on source set level.

    -

    Default is PUBLIC.

    +

    Default: PUBLIC.

    ### External documentation configuration -Configuration block that allows creating links leading to externally hosted documentation of your dependencies. +The `externalDocumentationLinks` configuration block allows you to add links that lead to the externally hosted documentation of your dependencies. -For instance, if you are using types from `kotlinx.serialization`, by default they will be unclickable in your -documentation, as if unresolved. However, since API reference for `kotlinx.serialization` is also built by Dokka and is +For example, if you are using types from `kotlinx.serialization`, by default they are unclickable in your +documentation, as if they are unresolved. However, since the API reference for `kotlinx.serialization` is also built by Dokka and is [published on kotlinlang.org](https://kotlinlang.org/api/kotlinx.serialization/), you can configure external -documentation links for it, allowing Dokka to generate links for used types, making them clickable -and appear resolved. +documentation links for it. Thus allowing Dokka to generate links for types, making them clickable +and resolve successfully. -Configurable for all source sets at once, or [for each source set individually](#source-set-configuration) +You can configure source sets together all at once, or [individually](#source-set-configuration): ```json { @@ -710,27 +714,27 @@ Configurable for all source sets at once, or [for each source set individually]( -

    Root URL of documentation to link with. Must contain a trailing slash.

    +

    The root URL of documentation to link with. It **must** contain a trailing slash.

    - Dokka will do its best to automatically find package-list for the given URL, + Dokka does its best to automatically find package-list for the given URL and link declarations together.

    If automatic resolution fails or if you want to use locally cached files instead, - consider providing packageListUrl. + consider providing the packageListUrl.

    - Specifies the exact location of a package-list instead of relying on Dokka - automatically resolving it. Can also be a locally cached file to avoid network calls. + The exact location of a package-list. This is an alternative to relying on Dokka + automatically resolving it. This can also be a locally cached file to avoid network calls.

    ### Complete configuration -Below you can see all possible configuration options applied at once. +Below you can see all the possible configuration options applied at the same time. ```json { diff --git a/docs/topics/runners/gradle.md b/docs/topics/runners/gradle.md index 78b2b759430..9f05e58f1c9 100644 --- a/docs/topics/runners/gradle.md +++ b/docs/topics/runners/gradle.md @@ -1,12 +1,12 @@ [//]: # (title: Gradle plugin) -To generate documentation for a Gradle-based project, you can use [Dokka Gradle plugin](#applying-the-plugin). +To generate documentation for a Gradle-based project, you can use the [Dokka Gradle plugin](#applying-the-plugin). It comes with basic autoconfiguration (including multi-project and multiplatform builds), has convenient [Gradle tasks](#generating-documentation) for generating documentation, and provides a great deal of [configuration options](#configuration) to customize output. -You can play around with Dokka and see how it can be configured for various projects by visiting +You can play around with Dokka and see how it can be configured for various projects by visiting our [Gradle example projects](https://github.com/Kotlin/dokka/tree/%dokkaVersion%/examples/gradle). ## Applying the plugin @@ -35,7 +35,7 @@ plugins {
    -When documenting [multi-project](gradle.md#multi-project-builds) builds, you need to apply Dokka in subprojects as well. +When documenting [multi-project](gradle.md#multi-project-builds) builds, you need to apply the Dokka plugin within subprojects as well. You can use `allprojects {}` and `subprojects {}` Gradle configurations to achieve that: @@ -59,17 +59,17 @@ subprojects {
    -> Under the hood, Dokka uses [Kotlin Gradle plugin](https://kotlinlang.org/docs/gradle.html) to perform +> Under the hood, Dokka uses the [Kotlin Gradle plugin](https://kotlinlang.org/docs/gradle.html) to perform > autoconfiguration -> of [source sets](https://kotlinlang.org/docs/multiplatform-discover-project.html#source-sets) for which documentation -> should be generated, so make sure Kotlin Gradle Plugin is applied as well, or +> of [source sets](https://kotlinlang.org/docs/multiplatform-discover-project.html#source-sets) for documentation +> to be generated. Make sure to apply Kotlin Gradle Plugin or > [configure source sets](#source-set-configuration) manually. > {type="note"} > If you are using Dokka in a > [precompiled script plugin](https://docs.gradle.org/current/userguide/custom_plugins.html#sec:precompiled_plugins), -> you will have to add [Kotlin Gradle plugin](https://kotlinlang.org/docs/gradle.html) as a dependency in order for +> you need to add the [Kotlin Gradle plugin](https://kotlinlang.org/docs/gradle.html) as a dependency in order for > it to work properly: > > @@ -91,14 +91,14 @@ subprojects { > {type="note"} -If you cannot use plugins DSL for some reason, you can use +If you cannot use the plugin DSL for some reason, you can use [the legacy method](https://docs.gradle.org/current/userguide/plugins.html#sec:old_plugin_application) of applying plugins. ## Generating documentation -Dokka's Gradle plugin comes with [HTML](html.md), [Markdown](markdown.md) and [Javadoc](javadoc.md) formats built in, -and adds a number of tasks for generating documentation, both for [single](#single-project-builds) +Dokka's Gradle plugin comes with [HTML](html.md), [Markdown](markdown.md) and [Javadoc](javadoc.md) output formats built in. +It adds a number of tasks for generating documentation, both for [single](#single-project-builds) and [multi-project](#multi-project-builds) builds. ### Single project builds @@ -119,13 +119,13 @@ Use the following tasks to build documentation for simple, single project applic | `dokkaJavadoc` | Generates documentation in [Javadoc](javadoc.md) format. | | `dokkaJekyll` | Generates documentation in [Jekyll compatible Markdown](markdown.md#jekyll) format. | -By default, you will find generated documentation under `build/dokka/{format}` directory of your project. -Output location, among other things, can be [configured](#configuration) separately. +By default, generated documentation is stored in the `build/dokka/{format}` directory of your project. +The output location, among other things, can be [configured](#configuration) separately. ### Multi-project builds For documenting [multi-project builds](https://docs.gradle.org/current/userguide/multi_project_builds.html), make sure -you apply the Dokka plugin in subprojects that you want to generate documentation for, as well as in their parent project. +that you apply the Dokka plugin within subprojects that you want to generate documentation for, as well as in their parent project. #### MultiModule tasks @@ -137,23 +137,23 @@ Dokka creates the following tasks for **parent** projects automatically: #### Stable formats -| **Task** | **Description** | -|--------------------------|--------------------------------------------------------------------------------------------------| -| `dokkaHtmlMultiModule` | Generates multi-module documentation in [HTML](html.md) format. | +| **Task** | **Description** | +|--------------------------|------------------------------------------------------------------------| +| `dokkaHtmlMultiModule` | Generates multi-module documentation in [HTML](html.md) output format. | #### Experimental formats -| **Task** | **Description** | -|--------------------------|--------------------------------------------------------------------------------------------------| -| `dokkaGfmMultiModule` | Generates multi-module documentation in [GitHub Flavored Markdown](markdown.md#gfm) format. | -| `dokkaJekyllMultiModule` | Generates multi-module documentation in [Jekyll compatible Markdown](markdown.md#jekyll) format. | +| **Task** | **Description** | +|--------------------------|---------------------------------------------------------------------------------------------------------| +| `dokkaGfmMultiModule` | Generates multi-module documentation in [GitHub Flavored Markdown](markdown.md#gfm) output format. | +| `dokkaJekyllMultiModule` | Generates multi-module documentation in [Jekyll compatible Markdown](markdown.md#jekyll) output format. | -> [Javadoc](javadoc.md) output format does not have a MultiModule task, but a [Collector](#collector-tasks) task can +> The [Javadoc](javadoc.md) output format does not have a MultiModule task, but a [Collector](#collector-tasks) task can > be used instead. > {type="note"} -By default, you will find ready-to-use documentation under `{parentProject}/build/dokka/{format}MultiModule` directory. +By default, you can find ready-to-use documentation under `{parentProject}/build/dokka/{format}MultiModule` directory. #### MultiModule task example @@ -169,16 +169,17 @@ parentProject ├── ChildProjectBClass ``` -You will see these pages generated after running `dokkaHtmlMultiModule`: +These pages are generated after running `dokkaHtmlMultiModule`: ![Screenshot for output of dokkaHtmlMultiModule task](dokkaHtmlMultiModule-example.png){width=600} -Visit [multi-module project example](https://github.com/Kotlin/dokka/tree/master/examples/gradle/dokka-multimodule-example) +See our [multi-module project example](https://github. +com/Kotlin/dokka/tree/master/examples/gradle/dokka-multimodule-example) for more details. #### Partial tasks -Each subproject will have _partial_ tasks created for it: `dokkaHtmlPartial`,`dokkaGfmPartial`, +Each subproject has _partial_ tasks created for it: `dokkaHtmlPartial`,`dokkaGfmPartial`, and `dokkaJekyllPartial`. These tasks are not intended to be used independently and exist only to be called by the parent's @@ -187,20 +188,21 @@ These tasks are not intended to be used independently and exist only to be calle Output generated by partial tasks contains non-displayable formatting along with unresolved templates and references. > If you want to generate documentation for a single subproject only, use -> [single project tasks](#single-project-builds). For instance, `:subproject:dokkaHtml`. +> [single project tasks](#single-project-builds). For example, `:subproject:dokkaHtml`. #### Collector tasks -Similar to MultiModule tasks, _Collector_ tasks will be created for each parent project: `dokkaHtmlCollector`, +Similar to MultiModule tasks, _Collector_ tasks are created for each parent project: `dokkaHtmlCollector`, `dokkaGfmCollector`, `dokkaJavadocCollector` and `dokkaJekyllCollector`. -A Collector task executes corresponding [single project task](#single-project-builds) for each subproject (for example, +A Collector task executes the corresponding [single project task](#single-project-builds) for each subproject (for +example, `dokkaHtml`), and merges all outputs into a single virtual project. -Resulting documentation will look as if you have a single project +The resulting documentation looks as if you have a single project build that contains all declarations from the subprojects. -> Use `dokkaJavadocCollector` task if you need to create Javadoc documentation for your multi-project build. +> Use the `dokkaJavadocCollector` task if you need to create Javadoc documentation for your multi-project build. > {type="tip"} @@ -218,21 +220,21 @@ parentProject ├── ChildProjectBClass ``` -You will see these pages generated after running `dokkaHtmlCollector`: +These pages are generated after running `dokkaHtmlCollector`: ![Screenshot for output of dokkaHtmlCollector task](dokkaHtmlCollector-example.png){width=800} -Visit [multi-module project example](https://github.com/Kotlin/dokka/tree/master/examples/gradle/dokka-multimodule-example) +See our [multi-module project example](https://github. +com/Kotlin/dokka/tree/master/examples/gradle/dokka-multimodule-example) for more details. ## Building javadoc.jar In order to publish your library to a repository, you may need to provide a `javadoc.jar` file that contains API -reference -documentation. +reference documentation. Dokka's Gradle plugin does not provide any way to do this out of the box, but it can be achieved with custom Gradle -tasks, one for generating documentation in [HTML](html.md) format and another one for [Javadoc](javadoc.md) format: +tasks. One for generating documentation in [HTML](html.md) format and another one for [Javadoc](javadoc.md) format: @@ -272,20 +274,20 @@ tasks.register('dokkaJavadocJar', Jar.class) { > If you publish your library to Maven Central, you can use services like [javadoc.io](https://javadoc.io/) to -> host of your library's API documentation for free and without any setup - it will take documentation pages straight -> from the artifact. It works with both HTML and Javadoc formats as demonstrated by +> host your library's API documentation for free and without any setup. It takes documentation pages straight +> from the artifact. It works with both HTML and Javadoc formats as demonstrated in > [this example](https://javadoc.io/doc/com.trib3/server/latest/index.html). > {type="tip"} ## Configuration -You can configure tasks/formats individually: +You can configure tasks and output formats individually: -If you applied Dokka via [plugins DSL](#applying-the-plugin) block: +Applying the Dokka plugin via the [plugins DSL](#applying-the-plugin) block: ```kotlin tasks.dokkaHtml { @@ -322,7 +324,7 @@ dokkaHtmlPartial { -Alternatively, you can configure all tasks/formats at once, including [MultiModule](#multi-project-builds), +Alternatively, you can configure all tasks and output formats at the same time, including [MultiModule](#multi-project-builds), [Partial](#partial-tasks) and [Collector](#collector-tasks) tasks: @@ -351,8 +353,8 @@ tasks.withType().configureEach { } } -// configure partial tasks of all output formats, -// these can have subproject-specific settings +// Configure partial tasks of all output formats. +// These can have subproject-specific settings. tasks.withType(DokkaTaskPartial::class).configureEach { dokkaSourceSets.configureEach { includes.from("README.md") @@ -367,8 +369,8 @@ tasks.withType(DokkaTaskPartial::class).configureEach { import org.jetbrains.dokka.gradle.DokkaTask import org.jetbrains.dokka.gradle.DokkaTaskPartial -// configure all dokka tasks, including multimodule, -// partial and collector ones +// Configure all Dokka tasks, including multimodule, +// partial and collector tasks tasks.withType(DokkaTask.class) { dokkaSourceSets.configureEach { documentedVisibilities.set([ @@ -383,8 +385,8 @@ tasks.withType(DokkaTask.class) { } } -// configure partial tasks of all output formats, -// these can have subproject-specific settings +// Configure partial tasks of all output formats. +// These can have subproject-specific settings. tasks.withType(DokkaTaskPartial.class) { dokkaSourceSets.configureEach { includes.from("README.md") @@ -399,12 +401,12 @@ tasks.withType(DokkaTaskPartial.class) { Dokka has many configuration options to tailor your and your reader's experience. -Below you will find examples and descriptions for each configuration section. You can also find an example with -[all configuration options](#complete-configuration) applied at once at the very bottom. +Below are some examples and detailed descriptions for each configuration section. You can also find an example +with [all configuration options](#complete-configuration) applied. ### General configuration -General configuration of any Dokka task, regardless of source set and package: +Here is an example of general configuration of any Dokka task, regardless of source set or package: @@ -453,32 +455,32 @@ tasks.withType(DokkaTask.class) { -

    Display name used to refer to the module. Used for ToC, navigation, logging, etc.

    -

    If set for a single-project build or a MultiModule task, will be used as project name.

    -

    Default is Gradle project name.

    +

    The display name used to refer to the module. It is used for the table of contents, navigation, logging, etc.

    +

    If set for a single-project build or a MultiModule task, it is used as the project name.

    +

    The default is the Gradle project name.

    - Module version. If set for a single-project build or a MultiModule task, will be used as project version + The module version. If set for a single-project build or a MultiModule task, it is used as the project version by the versioning plugin.

    -

    Default is Gradle project version.

    +

    Default: Gradle project version.

    -

    Directory to which documentation will be generated, regardless of format. Can be set on per-task basis.

    +

    The directory where documentation is generated, regardless of format. It can be set on a per-task basis.

    - Default is project/buildDir/format, where format is the task name with - removed "dokka" prefix. For task dokkaHtmlMultiModule it will be - project/buildDir/htmlMultiModule + The default is project/buildDir/format, where format is the task name with + the "dokka" prefix removed. For the dokkaHtmlMultiModule task, it is + project/buildDir/htmlMultiModule.

    Whether to fail documentation generation if Dokka has emitted a warning or an error. - Will wait until all errors and warnings have been emitted first. + The process waits until all errors and warnings have been emitted first.

    This setting works well with reportUndocumented

    -

    Default is false.

    +

    Default: false.

    Whether to suppress obvious functions.

    @@ -495,7 +497,7 @@ tasks.withType(DokkaTask.class) {

    -

    Default is true.

    +

    Default: true.

    Whether to suppress inherited members that aren't explicitly overridden in a given class.

    @@ -505,30 +507,30 @@ tasks.withType(DokkaTask.class) { dataClass.copy. Use suppressObviousFunctions for that.

    -

    Default is false.

    +

    Default: false.

    -

    Whether to resolve remote files/links over network.

    +

    Whether to resolve remote files/links over your network.

    - This includes package-lists used for generating external documentation links: - for instance, to make classes from standard library clickable. + This includes package-lists used for generating external documentation links. + For example, to make classes from standard library clickable.

    Setting this to true can significantly speed up build times in certain cases, - but can also worsen documentation quality and user experience, for instance by + but can also worsen documentation quality and user experience. For example, by not resolving some dependency's class/member links.

    Note: you can cache fetched files locally and provide them to Dokka as local paths. See externalDocumentationLinks section.

    -

    Default is false.

    +

    Default: false.

    ### Source set configuration -Configuration of Kotlin [source sets](https://kotlinlang.org/docs/multiplatform-discover-project.html#source-sets). +Here is an example of how to configure Kotlin [source sets](https://kotlinlang.org/docs/multiplatform-discover-project.html#source-sets). @@ -630,32 +632,32 @@ tasks.withType(DokkaTask.class) {

    Whether this source set should be skipped when generating documentation.

    -

    Default is false.

    +

    Default: false.

    -

    Display name used to refer to the source set.

    +

    The display name used to refer to the source set.

    - The name will be used both externally (for example, as source set name visible to documentation readers) and + The name is used both externally (for example, as source set name visible to documentation readers) and internally (for example, for logging messages of reportUndocumented).

    By default, the value is deduced from information provided by the Kotlin Gradle plugin.

    -

    Set of visibility modifiers that should be documented.

    +

    The set of visibility modifiers that should be documented.

    This can be used if you want to document protected/internal/private declarations, as well as if you want to exclude public declarations and only document internal API.

    Can be configured on per-package basis.

    -

    Default is DokkaConfiguration.Visibility.PUBLIC.

    +

    Default: DokkaConfiguration.Visibility.PUBLIC.

    Whether to emit warnings about visible undocumented declarations, that is declarations without KDocs after they have been filtered by documentedVisibilities.

    -

    This setting works well with failOnWarning. Can be overridden for a specific package.

    -

    Default is false.

    +

    This setting works well with failOnWarning. It can be overridden for a specific package.

    +

    Default: false.

    @@ -663,106 +665,109 @@ tasks.withType(DokkaTask.class) { various filters have been applied.

    - For instance, if skipDeprecated is set to true and your package contains only - deprecated declarations, it will be considered to be empty. + For example, if skipDeprecated is set to true and your package contains only + deprecated declarations, it is considered to be empty.

    -

    Default is true.

    +

    Default: true.

    Whether to document declarations annotated with @Deprecated.

    -

    Can be overridden on package level.

    -

    Default is false.

    +

    It can be overridden at package level.

    +

    Default: false.

    Whether to document/analyze generated files.

    - Generated files are expected to be present under {project}/{buildDir}/generated directory. - If set to true, it effectively adds all files from that directory to + Generated files are expected to be present under the {project}/{buildDir}/generated directory. + If set to true, it effectively adds all files from that directory to the suppressedFiles option, so you can configure it manually.

    -

    Default is true.

    +

    Default: true.

    -

    JDK version to use when generating external documentation links for Java types.

    +

    The JDK version to use when generating external documentation links for Java types.

    - For instance, if you use java.util.UUID from JDK in some public declaration signature, - and this property is set to 8, Dokka will generate an external documentation link + For example, if you use java.util.UUID from the JDK in some public declaration signature, + and this property is set to 8, Dokka generates an external documentation link to JDK 8 Javadocs for it.

    -

    Default is JDK 8.

    +

    Default: JDK 8.

    - Kotlin language version + The Kotlin language version used for setting up analysis and @sample environment.

    -

    By default, the latest language version available to Dokka's embedded compiler will be used.

    +

    By default, the latest language version available to Dokka's embedded compiler is used.

    - Kotlin API version + The Kotlin API version used for setting up analysis and @sample environment.

    -

    By default, it will be deduced from languageVersion.

    +

    By default, it is deduced from languageVersion.

    Whether to generate external documentation links that lead to API reference documentation for Kotlin's standard library when declarations from it are used.

    -

    Default is false, meaning links will be generated.

    +

    Links are generated when `noStdLibLink` is set to false.

    +

    Default: false.

    Whether to generate external documentation links to JDK's Javadocs when declarations from it are used.

    -

    The version of JDK Javadocs is determined by jdkVersion property.

    -

    Default is false, meaning links will be generated.

    +

    The version of JDK Javadocs is determined by the jdkVersion property.

    +

    Links are generated when `noJdkLink` is set to false.

    +

    Default: false.

    Whether to generate external documentation links for Android SDK API reference when declarations from it are used.

    -

    Only relevant in Android projects, ignored otherwise.

    -

    Default is false, meaning links will be generated.

    +

    This is only relevant in Android projects, ignored otherwise.

    +

    Links are generated when `noAndroidSdkLink` is set to false.

    +

    Default: false.

    - List of Markdown files that contain + A list of Markdown files that contain module and package documentation.

    -

    Contents of specified files will be parsed and embedded into documentation as module and package descriptions.

    +

    The contents of the specified files are parsed and embedded into documentation as module and package descriptions.

    See Dokka gradle example - for an example of how to use it and what it will look like. + for an example of how to use it and what it looks like.

    - Platform to be used for setting up code analysis and + The platform to be used for setting up code analysis and @sample environment.

    The default value is deduced from information provided by the Kotlin Gradle plugin.

    - Source code roots to be analyzed and documented. - Accepts directories and individual .kt / .java files. + The source code roots to be analyzed and documented. + Acceptable formats are directories and individual .kt / .java files.

    By default, source roots are deduced from information provided by the Kotlin Gradle plugin.

    -

    Classpath for analysis and interactive samples.

    +

    The classpath for analysis and interactive samples.

    - Useful if some types that come from dependencies are not resolved/picked up automatically. - Property accepts both .jar and .klib files. + This iu Useful if some types that come from dependencies are not resolved/picked up automatically. + The property accepts both .jar and .klib files.

    By default, classpath is deduced from information provided by the Kotlin Gradle plugin.

    - List of directories or files that contain sample functions which are referenced via + A list of directories or files that contain sample functions which are referenced via @sample KDoc tag.

    @@ -770,13 +775,13 @@ tasks.withType(DokkaTask.class) { ### Source link configuration -Configuration block that allows adding a `source` link to each signature -which leads to `remoteUrl` with a specific line number (configurable by setting `remoteLineSuffix`), -letting documentation readers find source code for each declaration. +The `sourceLinks` configuration block is where you can add a `source` link to each signature +that leads to a `remoteUrl` with a specific line number. (The line number is configurable by setting `remoteLineSuffix`). +This helps readers to find the source code for each declaration. -For an example, see documentation for -[count](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/count.html) -function from `kotlinx.coroutines`. +For an example, see the documentation for the +[`count()`](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/count.html) +function in `kotlinx.coroutines`. @@ -836,26 +841,26 @@ tasks.withType(DokkaTask.class) {

    - Path to the local source directory. The path must be relative to the root of - current project. + The path to the local source directory. The path must be relative to the root of + the current project.

    - URL of source code hosting service that can be accessed by documentation readers, - like GitHub, GitLab, Bitbucket, etc. This URL will be used to generate + The URL of the source code hosting service that can be accessed by documentation readers, + like GitHub, GitLab, Bitbucket, etc. This URL is used to generate source code links of declarations.

    - Suffix used to append source code line number to the URL. This will help readers navigate + The suffix used to append the source code line number to the URL. This helps readers navigate not only to the file, but to the specific line number of the declaration.

    - The number itself will be appended to the specified suffix. For instance, - if this property is set to #L and the line number is 10, resulting URL suffix - will be #L10. + The number itself is appended to the specified suffix. For example, + if this property is set to #L and the line number is 10, the resulting URL suffix + is #L10.

    Suffixes used by popular services: @@ -865,13 +870,13 @@ tasks.withType(DokkaTask.class) {

  • Bitbucket: #lines-
  • -

    Default is #L.

    +

    Default: #L.

    ### Package options -Configuration block that allows setting some options for specific packages matched by `matchingRegex`. +Here is an example of a configuration block that allows setting some options for specific packages matched by `matchingRegex`. @@ -910,12 +915,12 @@ import org.jetbrains.dokka.gradle.DokkaTask tasks.withType(DokkaTask.class) { // .. - // general configuration section + // General configuration section // .. dokkaSourceSets.configureEach { // .. - // source set configuration section + // Source set configuration section // .. perPackageOption { @@ -934,47 +939,47 @@ tasks.withType(DokkaTask.class) { -

    Regular expression that is used to match the package.

    -

    Default is any string: .*.

    +

    The regular expression that is used to match the package.

    +

    Default: any string: .*.

    Whether this package should be skipped when generating documentation.

    -

    Default is false.

    +

    Default: false.

    Whether to document declarations annotated with @Deprecated.

    -

    Can be configured on source set level.

    -

    Default is false.

    +

    This can be configured on source set level.

    +

    Default: false.

    - Whether to emit warnings about visible undocumented declarations, that is declarations from + Whether to emit warnings about visible undocumented declarations. That is declarations from this package and without KDocs, after they have been filtered by documentedVisibilities.

    This setting works well with failOnWarning.

    -

    Can be configured on source set level.

    -

    Default is false.

    +

    This can be configured on source set level.

    +

    Default: false.

    -

    Set of visibility modifiers that should be documented.

    +

    The set of visibility modifiers that should be documented.

    This can be used if you want to document protected/internal/private declarations within a specific package, as well as if you want to exclude public declarations and only document internal API.

    -

    Can be configured on source set level.

    -

    Default is DokkaConfiguration.Visibility.PUBLIC.

    +

    This can be configured on source set level.

    +

    Default: DokkaConfiguration.Visibility.PUBLIC.

    ### External documentation links configuration -Configuration block that allows creating links leading to externally hosted documentation of your dependencies. +The externalDocumentationLink` block allows the creation of links that lead to the externally hosted documentation of your dependencies. -For instance, if you are using types from `kotlinx.serialization`, by default they will be unclickable in your -documentation, as if unresolved. However, since API reference for `kotlinx.serialization` is also built by Dokka and is -[published on kotlinlang.org](https://kotlinlang.org/api/kotlinx.serialization/), you can configure external -documentation links for it, allowing Dokka to generate links for used types, making them clickable -and appear resolved. +For example, if you are using types from `kotlinx.serialization`, by default they are unclickable in your +documentation, as if they are unresolved. However, since the API reference for `kotlinx.serialization` is also built by Dokka and is +[published on kotlinlang.org](https://kotlinlang.org/api/kotlinx.serialization/), you can configure external +documentation links for it. Thus allowing Dokka to generate links for types, making them clickable +and resolve successfully. @@ -1035,9 +1040,9 @@ tasks.withType(DokkaTask.class) { -

    Root URL of documentation to link with. Must contain a trailing slash.

    +

    The root URL of documentation to link with. It **must** contain a trailing slash.

    - Dokka will do its best to automatically find package-list for the given URL, + Dokka does its best to automatically find package-list for the given URL, and link declarations together.

    @@ -1048,14 +1053,14 @@ tasks.withType(DokkaTask.class) {

    Specifies the exact location of a package-list instead of relying on Dokka - automatically resolving it. Can also be a locally cached file to avoid network calls. + automatically resolving it. It can also be a locally cached file to avoid network calls.

    ### Complete configuration -Below you can see all possible configuration options applied at once. +Below you can see all possible configuration options applied at the same time. diff --git a/docs/topics/runners/maven.md b/docs/topics/runners/maven.md index a571090c194..7ba7dcea44f 100644 --- a/docs/topics/runners/maven.md +++ b/docs/topics/runners/maven.md @@ -1,18 +1,18 @@ [//]: # (title: Maven plugin) -To generate documentation for Maven-based projects, you can use [Dokka Maven plugin](#applying-the-plugin). +To generate documentation for Maven-based projects, you can use the [Dokka Maven plugin](#applying-the-plugin). -> Compared to the [Gradle plugin](gradle.md), Maven plugin has only basic features and +> Compared to the [Gradle plugin](gradle.md), the Maven plugin has only basic features and > does not provide support for multimodule builds out of the box. > {type="note"} You can play around with Dokka and see how it can be configured for a Maven project by visiting -[Maven example](https://github.com/Kotlin/dokka/tree/%dokkaVersion%/examples/maven) project. +our [Maven example](https://github.com/Kotlin/dokka/tree/%dokkaVersion%/examples/maven) project. ## Applying the plugin -To apply the plugin, you need to add it to the plugins section of your POM: +To apply the plugin, you need to add it to the plugins section of your POM file: ```xml @@ -36,7 +36,7 @@ To apply the plugin, you need to add it to the plugins section of your POM: ## Generating documentation -Following goals are provided by the plugin: +The following goals are provided by the plugin: ### Stable @@ -53,13 +53,11 @@ Following goals are provided by the plugin: ### Other output formats -By default, Maven plugin will build documentation in [HTML](html.md) format. +By default, the Maven plugin builds documentation in [HTML](html.md) output format. -All other output formats come as [Dokka plugins](plugins_introduction.md). In order to use it, you have to apply -it as a dependency. +All other output formats come as part of [Dokka plugins](plugins_introduction.md). In order to use them, you have to apply -For example, to use experimental [GFM](markdown.md#gfm) format, you have to apply `org.jetbrains.dokka:gfm-plugin` in -the following way: +For example, to use the experimental [GFM](markdown.md#gfm) format, you have to apply `org.jetbrains.dokka:gfm-plugin` in ```xml @@ -78,18 +76,18 @@ the following way: ``` -After that, running `dokka:dokka` goal should produce documentation in GFM format. +With this configuration, running the `dokka:dokka` goal produces documentation in GFM format. -You can learn more about Dokka plugins in [a separate topic](plugins_introduction.md). +To learn more about Dokka plugins, see [Dokka plugins](plugins_introduction.md). ## Building javadoc.jar -Unlike the [Gradle plugin](gradle.md#building-javadoc-jar), Maven plugin comes with ready-to-use `dokka:javadocJar` goal. -By default, it will generate documentation in [Javadoc](javadoc.md) format under `target` folder. +Unlike the [Gradle plugin](gradle.md#building-javadoc-jar), the Maven plugin comes with a ready-to-use `dokka:javadocJar` goal. +By default, it generates documentation in [Javadoc](javadoc.md) output format in the`target` folder. If you are not satisfied with the built-in goal or want to customize the output (for instance, you want to generate -documentation in [HTML](html.md) format instead of Javadoc), similar behaviour can be achieved by adding the -Maven jar plugin with the following configuration: +documentation in [HTML](html.md) format instead of Javadoc), similar behavior can be achieved by adding the +Maven JAR plugin with the following configuration: ```xml @@ -118,7 +116,7 @@ Maven jar plugin with the following configuration: ``` -The documentation and the `.jar` archive for it can then be generated by running `dokka:dokka` and `jar:jar@dokka-jar` goals: +The documentation and the `.jar` archive for it is then generated by running `dokka:dokka` and `jar:jar@dokka-jar` goals: ```Bash mvn dokka:dokka jar:jar@dokka-jar @@ -128,7 +126,7 @@ mvn dokka:dokka jar:jar@dokka-jar Maven's plugin configuration block can be used to configure Dokka. -Example of basic configuration that only changes output location of documentation: +Here is an example of a basic configuration that only changes the output location of your documentation: ```xml @@ -145,8 +143,8 @@ Example of basic configuration that only changes output location of documentatio Dokka has many configuration options to tailor your experience. -Below you will find examples and descriptions for each configuration section. You can also find an example with -[all configuration options](#complete-configuration) applied at once at the very bottom. +Below are some examples and detailed descriptions for each configuration section. You can also find an example +with [all configuration options](#complete-configuration) applied. ### General configuration @@ -206,23 +204,23 @@ Below you will find examples and descriptions for each configuration section. Yo

    Whether to skip documentation generation.

    -

    Default is false.

    +

    Default: false.

    -

    Display name used to refer to the project/module. Used for ToC, navigation, logging, etc.

    -

    Default is {project.artifactId}.

    +

    The display name used to refer to the project/module. It's used for the table of contents, navigation, logging, etc.

    +

    Default: {project.artifactId}.

    -

    Directory to which documentation will be generated.

    -

    Default is {project.basedir}/target/dokka.

    +

    The directory where documentation is generated.

    +

    Default: {project.basedir}/target/dokka.

    - Whether to fail documentation generation if Dokka has emitted a warning or an error. Will wait until + Whether to fail documentation generation if Dokka has emitted a warning or an error. The process waits until all errors and warnings have been emitted first.

    This setting works well with reportUndocumented.

    -

    Default is false.

    +

    Default: false.

    Whether to suppress obvious functions.

    @@ -239,7 +237,7 @@ Below you will find examples and descriptions for each configuration section. Yo

    -

    Default is true

    +

    Default: true

    Whether to suppress inherited members that aren't explicitly overridden in a given class.

    @@ -248,7 +246,7 @@ Below you will find examples and descriptions for each configuration section. Yo but cannot suppress synthetic functions such as dataClass.componentN and dataClass.copy. Use suppressObviousFunctions for that.

    -

    Default is false.

    +

    Default: false.

    Whether to resolve remote files/links over network.

    @@ -258,30 +256,30 @@ Below you will find examples and descriptions for each configuration section. Yo

    Setting this to true can significantly speed up build times in certain cases, - but can also worsen documentation quality and user experience, for instance by + but can also worsen documentation quality and user experience, for example by not resolving some dependency's class/member links.

    When using offline mode, you can cache fetched files locally and provide them to Dokka as local paths, see externalDocumentationLinks section.

    -

    Default is false.

    +

    Default: false.

    - Source code roots to be analyzed and documented. - Accepts directories and individual .kt / .java files. + The source code roots to be analyzed and documented. + Acceptable inputs are directories and individual .kt / .java files.

    -

    Default is {project.compileSourceRoots}.

    +

    Default: {project.compileSourceRoots}.

    -

    Set of visibility modifiers that should be documented.

    +

    The set of visibility modifiers that should be documented.

    This can be used if you want to document protected/internal/private declarations, as well as if you want to exclude public declarations and only document internal API.

    Can be configured on per-package basis.

    -

    Default is PUBLIC.

    +

    Default: PUBLIC.

    @@ -289,82 +287,84 @@ Below you will find examples and descriptions for each configuration section. Yo after they have been filtered by documentedVisibilities.

    This setting works well with failOnWarning.

    -

    Can be overridden on package level.

    -

    Default is false.

    +

    This can be overridden at package level.

    +

    Default: false.

    Whether to document declarations annotated with @Deprecated.

    -

    Can be overridden on package level.

    -

    Default is false.

    +

    This can be overridden at package level.

    +

    Default: false.

    Whether to skip packages that contain no visible declarations after various filters have been applied.

    - For instance, if skipDeprecated is set to true and your package contains only - deprecated declarations, it will be considered to be empty.

    -

    Default is true.

    + For example, if skipDeprecated is set to true and your package contains only + deprecated declarations, it is considered empty.

    +

    Default: true.

    - Directories or individual files that should be suppressed, meaning declarations from them - will be not documented. + The directories or individual files that should be suppressed, meaning that declarations from them + are not documented.

    -

    JDK version to use when generating external documentation links for Java types.

    +

    The JDK version to use when generating external documentation links for Java types.

    - For instance, if you use java.util.UUID from JDK in some public declaration signature, - and this property is set to 8, Dokka will generate an external documentation link + For example, if you use java.util.UUID from JDK in some public declaration signature, + and this property is set to 8, Dokka generates an external documentation link to JDK 8 Javadocs for it.

    -

    Default is JDK 8.

    +

    Default: JDK 8.

    - Kotlin language version + The Kotlin language version used for setting up analysis and @sample environment.

    -

    By default, the latest language version available to Dokka's embedded compiler will be used.

    +

    By default, the latest language version available to Dokka's embedded compiler is used.

    - Kotlin API version + The Kotlin API version used for setting up analysis and @sample environment.

    -

    By default, it will be deduced from languageVersion.

    +

    By default, it is deduced from languageVersion.

    Whether to generate external documentation links that lead to API reference documentation for Kotlin's standard library when declarations from it are used.

    -

    Default is false, meaning links will be generated.

    +

    Links are generated when `noStdLibLink` is set to false.

    +

    Default: false.

    Whether to generate external documentation links to JDK's Javadocs when declarations from it are used.

    The version of JDK Javadocs is determined by jdkVersion property.

    -

    Default is false, meaning links will be generated.

    +

    Links are generated when `noJdkLink` is set to false.

    +

    Default: false

    - List of Markdown files that contain + A list of Markdown files that contain module and package documentation

    -

    Contents of specified files will be parsed and embedded into documentation as module and package descriptions.

    +

    The contents of specified files are parsed and embedded into documentation as module and package descriptions.

    -

    Classpath for analysis and interactive samples.

    +

    The classpath for analysis and interactive samples.

    - Useful if some types that come from dependencies are not resolved/picked up automatically. - Property accepts both .jar and .klib files. + This is useful if some types that come from dependencies are not resolved/picked up automatically. + The property accepts both .jar and .klib files.

    -

    Default is {project.compileClasspathElements}.

    +

    Default: {project.compileClasspathElements}.

    - List of directories or files that contain sample functions which are referenced via + A list of directories or files that contain sample functions which are referenced via @sample KDoc tag.

    @@ -372,9 +372,9 @@ Below you will find examples and descriptions for each configuration section. Yo ### Source link configuration -Configuration block that allows adding a `source` link to each signature which leads to `path` with a specific line -number (configurable by setting `lineSuffix`), letting documentation readers find source code for each -declaration. +The `sourceLinks` configuration block is where you can add a `source` link to each signature +that leads to a `remoteUrl` with a specific line number. (The line number is configurable by setting `remoteLineSuffix`). +This helps readers to find the source code for each declaration. For an example, see documentation for [count](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/count.html) @@ -400,24 +400,24 @@ function from `kotlinx.coroutines`.

    - Path to the local source directory. The path must be relative to the root of + The path to the local source directory. The path must be relative to the root of the current module.

    - URL of source code hosting service that can be accessed by documentation readers, like GitHub, GitLab, - Bitbucket, etc. This URL will be used to generate source code links of declarations. + The URL of the source code hosting service that can be accessed by documentation readers, like GitHub, GitLab, + Bitbucket, etc. This URL is used to generate source code links of declarations.

    - Suffix used to append source code line number to the URL. This will help readers navigate not only + The suffix used to append source code line number to the URL. This helps readers navigate not only to the file, but to the specific line number of the declaration.

    - The number itself will be appended to the specified suffix. For instance, if this property is set - to #L and the line number is 10, resulting URL suffix will be #L10. + The number itself is appended to the specified suffix. For example, if this property is set + to #L and the line number is 10, the resulting URL suffix is #L10.

    Suffixes used by popular services: @@ -432,13 +432,13 @@ function from `kotlinx.coroutines`. #### External documentation links configuration -Configuration block that allows creating links leading to externally hosted documentation of your dependencies. +The `externalDocumentationLinks` block allows the creation of links that lead to the externally hosted documentation of your dependencies. -For instance, if you are using types from `kotlinx.serialization`, by default they will be unclickable in your -documentation, as if unresolved. However, since API reference for `kotlinx.serialization` is also built by Dokka and is +For example, if you are using types from `kotlinx.serialization`, by default they are be unclickable in your +documentation, as if they are unresolved. However, since the API reference for `kotlinx.serialization` is also built by Dokka and is [published on kotlinlang.org](https://kotlinlang.org/api/kotlinx.serialization/), you can configure external -documentation links for it, allowing Dokka to generate links for used types, making them clickable -and appear resolved. +documentation links for it. Thus allowing Dokka to generate links for types, making them clickable +and resolve successfully. ```xml @@ -458,27 +458,27 @@ and appear resolved. -

    Root URL of documentation to link with. Must contain a trailing slash.

    +

    The root URL of documentation to link with. It **must** contain a trailing slash.

    - Dokka will do its best to automatically find package-list for the given URL, + Dokka does its best to automatically find the package-list for the given URL and link declarations together.

    - It automatic resolution fails or if you want to use locally cached files instead, - consider providing packageListUrl. + If automatic resolution fails or if you want to use locally cached files instead, + consider providing the packageListUrl.

    - Specifies the exact location of a package-list instead of relying on Dokka - automatically resolving it. Can also be a locally cached file to avoid network calls. + The exact location of a package-list. This is an alternative to relying on Dokka + automatically resolving it. This can also be a locally cached file to avoid network calls.

    ### Package options -Configuration block that allows setting some options for specific packages matched by `matchingRegex`. +The `packageOptions` configuration block allows you to set some options for specific packages matched by `matchingRegex`. ```xml @@ -507,25 +507,25 @@ Configuration block that allows setting some options for specific packages match -

    Regular expression that is used to match the package.

    -

    Default is any string: .*.

    +

    The regular expression that is used to match the package.

    +

    Default: any string: .*.

    Whether this package should be skipped when generating documentation.

    -

    Default is false.

    +

    Default: false.

    -

    List of visibility modifiers that should be documented.

    +

    A list of visibility modifiers that should be documented.

    This can be used if you want to document protected/internal/private declarations within a specific package, as well as if you want to exclude public declarations and only document internal API.

    -

    Default is PUBLIC.

    +

    Default: PUBLIC.

    Whether to document declarations annotated with @Deprecated.

    -

    Can be set on project/module level.

    -

    Default is false.

    +

    This can be set on project/module level.

    +

    Default: false.

    @@ -533,13 +533,13 @@ Configuration block that allows setting some options for specific packages match this package and without KDocs, after they have been filtered by documentedVisibilities.

    This setting works well with failOnWarning.

    -

    Default is false.

    +

    Default: false.

    ### Complete configuration -Below you can see all possible configuration options applied at once. +Below you can see all the possible configuration options applied at the same time. ```xml