diff options
author | Ignat Beresnev <ignat.beresnev@jetbrains.com> | 2023-02-20 19:15:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-20 19:15:42 +0100 |
commit | 57622719edb912d7c3320f7e59cd6928e5c25e44 (patch) | |
tree | e00db16dc54ce11b025cdb1bc8cf204bd6efebe3 /mkdocs | |
parent | 1e10c6f47d605e1e730cb58aa44f3051ec5a493b (diff) | |
download | dokka-57622719edb912d7c3320f7e59cd6928e5c25e44.tar.gz dokka-57622719edb912d7c3320f7e59cd6928e5c25e44.tar.bz2 dokka-57622719edb912d7c3320f7e59cd6928e5c25e44.zip |
Exclude user guides from mkdocs documentation (#2868)
Diffstat (limited to 'mkdocs')
-rw-r--r-- | mkdocs/README.md | 33 | ||||
-rw-r--r-- | mkdocs/src/doc/docs/community/plugins-list.md | 160 | ||||
-rw-r--r-- | mkdocs/src/doc/docs/developer_guide/architecture/extension_points/core_extensions.md | 2 | ||||
-rw-r--r-- | mkdocs/src/doc/docs/developer_guide/plugin-development/introduction.md | 11 | ||||
-rw-r--r-- | mkdocs/src/doc/docs/faq.md | 2 | ||||
-rw-r--r-- | mkdocs/src/doc/docs/images/mathjax_demo.png | bin | 31853 -> 0 bytes | |||
-rw-r--r-- | mkdocs/src/doc/docs/images/mermaid_demo.png | bin | 91709 -> 0 bytes | |||
-rw-r--r-- | mkdocs/src/doc/docs/index.md | 39 | ||||
-rw-r--r-- | mkdocs/src/doc/docs/user_guide/applying/cli.md | 158 | ||||
-rw-r--r-- | mkdocs/src/doc/docs/user_guide/applying/gradle.md | 380 | ||||
-rw-r--r-- | mkdocs/src/doc/docs/user_guide/applying/maven.md | 243 | ||||
-rw-r--r-- | mkdocs/src/doc/docs/user_guide/introduction.md | 74 | ||||
-rw-r--r-- | mkdocs/src/doc/docs/user_guide/output-formats/html.md | 112 | ||||
-rw-r--r-- | mkdocs/src/doc/docs/user_guide/plugins/android-plugin.md | 8 | ||||
-rw-r--r-- | mkdocs/src/doc/docs/user_guide/plugins/versioning-plugin.md | 86 | ||||
-rw-r--r-- | mkdocs/src/doc/mkdocs.yml | 26 |
16 files changed, 56 insertions, 1278 deletions
diff --git a/mkdocs/README.md b/mkdocs/README.md new file mode 100644 index 00000000..c8d07370 --- /dev/null +++ b/mkdocs/README.md @@ -0,0 +1,33 @@ +# MkDocs documentation + +This module contains documentation which is published to GitHub pages: +[kotlin.github.io/dokka](https://kotlin.github.io/dokka/). + +It is built using the [gradle-mkdocs-plugin](https://github.com/xvik/gradle-mkdocs-plugin). + +## Building + +You can build the documentation locally: + +```Bash +./gradlew :mkdocs:mkdocsBuild +``` + +The output directory is `build/mkdocs` + +### Livereload server + +Alternatively, you can run a livereload server that automatically rebuilds documentation on every change: + +```Bash +./gradlew :mkdocs:mkdocsServe +``` + +By default, it is run under [127.0.0.1:3001](http://127.0.0.1:3001/), but you can change it in +[mkdocs.yml](src/doc/mkdocs.yml) by setting the `dev_addr` option. + +## Publishing + +The documentation is published automatically for all changes in master and for every GitHub release. + +See [gh-pages.yml](../.github/workflows/gh-pages.yml) workflow configuration for more details. diff --git a/mkdocs/src/doc/docs/community/plugins-list.md b/mkdocs/src/doc/docs/community/plugins-list.md deleted file mode 100644 index 6ae8ce4c..00000000 --- a/mkdocs/src/doc/docs/community/plugins-list.md +++ /dev/null @@ -1,160 +0,0 @@ -# Dokka community plugins - -On this page you can find `Dokka` plugins which are supported by both `Dokka` maintainers and community members. - -If you want to add your plugin to this list, get in touch with maintainers via [Slack](../community/slack.md) -or `GitHub`. - -If you want to learn how to develop plugins for `Dokka`, see -[Plugin development](../developer_guide/plugin-development/introduction.md) section. - -## Output Formats - -### Javadoc (Alpha) - -Javadoc plugin adds a `Javadoc` output format that looks like Java's `Javadoc`, but it's for the most part -a lookalike, so you may experience problems if you try to use it with a tool that expects native -`Javadoc` documentation generated by `Java`. - -`Javadoc` plugin does not support multiplatform projects and does not have a multi-module task. - -`Javadoc` plugin is shipped with `Dokka`, so you can start using it right away with one of the following tasks: - -* `dokkaJavadoc` - builds `Javadoc` documentation for single-module projects or for a specific module. -* `dokkaJavadocCollector` - collects generated `Javadoc` documentation from submodules and assembles it together. - -`Javadoc` plugin has its own signature provider that essentially translates `Kotlin` signatures to `Java` ones. - -**This plugin is at its early stages**, so you may experience issues and encounter bugs. Feel free to -[report](https://github.com/Kotlin/dokka/issues/new/choose) any errors you see. - -[Plugin source code on GitHub](https://github.com/Kotlin/dokka/tree/master/plugins/javadoc) - -### GFM (Alpha) - -`GFM` plugins adds the ability to generate documentation in `GitHub flavoured Markdown` format. Supports both -multimodule and multiplatform projects, and is shipped together with `Dokka`, so you can start using it -right away with one of the following tasks: - -* `dokkaGfm` - generate documentation for a non multi-module project or one specific module. -* `dokkaGfmMultiModule` - generate documentation for a multi-module project, assemble it together and - generate navigation page/menu for all the modules. - -Example: - -___ - -//[dokka-debug-kts](#gfm)/[org.jetbrains.dokka.test](#gfm)/[MyClass](#gfm) - -#### MyClass - -[jvm] -class [MyClass](#gfm) - -KDoc that describes this class - -##### Constructors - -| | | -|---|---| -| [MyClass](#gfm) | [jvm]<br>fun [MyClass](#gfm)() | - -##### Functions - -| Name | Summary | -|------------------|---| -| [function](#gfm) | [jvm]<br>fun [function](#gfm)(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>KDoc comment on top of this function | - -##### Properties - -| Name | Summary | -|---|------------------------------------------------------------------------------------------------------------------------------------------------| -| [property](#gfm) | [jvm]<br>val [property](#gfm): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>KDoc comment for a property | - -___ - -**This plugin is at its early stages**, so you may experience issues and encounter bugs. Feel free to -[report](https://github.com/Kotlin/dokka/issues/new/choose) any errors you see. - -[Plugin source code on GitHub](https://github.com/Kotlin/dokka/tree/master/plugins/gfm) - -### Jekyll (Alpha) - -`Jekyll` plugins adds the ability to generate documentation in `Jekyll flavoured Markdown` format. Supports both -multi-module and multiplatform projects, and is shipped together with `Dokka`, so you can start using it -right away with one of the following tasks: - -* `dokkaJekyll` - generate documentation for a non multi-module project or one specific module. -* `dokkaJekyllMultiModule` - generate documentation for a multi-module project, assemble it together and - generate navigation page/menu for all the modules. - -**This plugin is at its early stages**, so you may experience issues and encounter bugs. Feel free to -[report](https://github.com/Kotlin/dokka/issues/new/choose) any errors you see. - -[Plugin source code on GitHub](https://github.com/Kotlin/dokka/tree/master/plugins/jekyll) - -## Extensions - -### Mathjax - -[MathJax](https://docs.mathjax.org/) allows you to include mathematics in your web pages. `MathJax` plugin -adds the ability to render mathematics from source code comments. - -If `MathJax` plugin encounters `@usesMathJax` `KDoc` tag, it adds `MathJax.js` (ver. 2) with `config=TeX-AMS_SVG` -to generated `HTML` pages. - -Usage example: -```kotlin -/** - * Some math \(\sqrt{3x-1}+(1+x)^2\) - * - * @usesMathJax - */ -class Foo {} -``` - -Which results in: - -![Mathjax demo](../images/mathjax_demo.png){ width="400" } - -[Plugin source code on GitHub](https://github.com/Kotlin/dokka/tree/master/plugins/mathjax) - -### Mermaid - -[Mermaid JS](https://mermaid-js.github.io/mermaid/#/) lets you create diagrams and visualizations using text and code. -`Mermaid` plugin allows rendering such diagrams and visualizations found in source code documentation. - -Usage example: -```kotlin -/** - * See the graph for more details: - * \```mermaid - * graph LR - * A[Christmas] -->|Get money| B(Go shopping) - * B --> C{Let me think} - * C -->|One| D[Laptop] - * C -->|Two| E[iPhone] - * C -->|Three| F[fa:fa-car Car] - * \``` - */ -class CompositeSubscription -``` - -Which results in: - -![Mermaid demo](../images/mermaid_demo.png){ width="700" } - -For more information and examples, see -[Html Mermaid Dokka plugin](https://github.com/glureau/dokka-mermaid) repository on GitHub. - -### Kotlin as Java - -With `Kotlin as Java` plugin applied, all `Kotlin` signatures will be rendered as `Java` signatures. - -For instance, `fun foo(bar: Bar): Baz` will be rendered as `public final Baz foo(Bar bar)`. - -`Kotlin as Java` plugin is published to maven central as a -[separate artifact](https://mvnrepository.com/artifact/org.jetbrains.dokka/kotlin-as-java-plugin): -`org.jetbrains.dokka:kotlin-as-java-plugin:1.7.20`. - -[Plugin source code on GitHub](https://github.com/Kotlin/dokka/tree/master/plugins/kotlin-as-java) diff --git a/mkdocs/src/doc/docs/developer_guide/architecture/extension_points/core_extensions.md b/mkdocs/src/doc/docs/developer_guide/architecture/extension_points/core_extensions.md index 381a9596..77ebc15e 100644 --- a/mkdocs/src/doc/docs/developer_guide/architecture/extension_points/core_extensions.md +++ b/mkdocs/src/doc/docs/developer_guide/architecture/extension_points/core_extensions.md @@ -147,5 +147,5 @@ and `CommonmarkRenderer`. `PostAction` is useful for when you want to run some actions after the documentation has been generated - for instance if you want to move some files around. -[Versioning plugin](../../../user_guide/plugins/versioning-plugin.md) utilizes `PostAction` in order to move +[Versioning plugin](https://github.com/Kotlin/dokka/tree/master/plugins/versioning) utilizes `PostAction` in order to move generated documentation to versioned folders. diff --git a/mkdocs/src/doc/docs/developer_guide/plugin-development/introduction.md b/mkdocs/src/doc/docs/developer_guide/plugin-development/introduction.md index fbfb32ac..6a487a5e 100644 --- a/mkdocs/src/doc/docs/developer_guide/plugin-development/introduction.md +++ b/mkdocs/src/doc/docs/developer_guide/plugin-development/introduction.md @@ -1,5 +1,13 @@ # Introduction to plugin development +Dokka was built from the ground up to be easily extensible and highly customizable, which allows the community to +implement plugins for missing or very specific features that are not provided out of the box. + +Dokka plugins range anywhere from supporting other programming language sources to exotic output formats. You can add +support for your own KDoc tags or annotations, teach Dokka how to render different DSLs that are found in KDoc +descriptions, visually redesign Dokka's pages to be seamlessly integrated into your company's website, integrate +it with other tools and so much more. + In order to have an easier time developing plugins, it's a good idea to go through [Dokka's internals](../architecture/architecture_overview.md) first to learn more about its [data model](../architecture/data_model/documentables.md) and @@ -51,7 +59,8 @@ versions of Dokka. You can follow the [sample plugin tutorial](sample-plugin-tutorial.md) which covers creation of a simple plugin: hide members annotated with your own `@Internal` annotation, that is exclude these members from generated documentation. -Fore more practical examples, have a look at sources of [community plugins](../../community/plugins-list.md). +Fore more practical examples, have a look at sources of +[community plugins](https://kotlinlang.org/docs/dokka-plugins.html#notable-plugins). ## Help diff --git a/mkdocs/src/doc/docs/faq.md b/mkdocs/src/doc/docs/faq.md deleted file mode 100644 index ef728ca0..00000000 --- a/mkdocs/src/doc/docs/faq.md +++ /dev/null @@ -1,2 +0,0 @@ -# FAQ -If you encounter any problems, please see [FAQ](https://github.com/Kotlin/dokka/wiki/faq). diff --git a/mkdocs/src/doc/docs/images/mathjax_demo.png b/mkdocs/src/doc/docs/images/mathjax_demo.png Binary files differdeleted file mode 100644 index 9b14a704..00000000 --- a/mkdocs/src/doc/docs/images/mathjax_demo.png +++ /dev/null diff --git a/mkdocs/src/doc/docs/images/mermaid_demo.png b/mkdocs/src/doc/docs/images/mermaid_demo.png Binary files differdeleted file mode 100644 index 0d0e27b6..00000000 --- a/mkdocs/src/doc/docs/images/mermaid_demo.png +++ /dev/null diff --git a/mkdocs/src/doc/docs/index.md b/mkdocs/src/doc/docs/index.md index 0f106c04..2cedfe35 100644 --- a/mkdocs/src/doc/docs/index.md +++ b/mkdocs/src/doc/docs/index.md @@ -1,38 +1,9 @@ # Dokka -`Dokka` is an API documentation engine for `Kotlin` that performs the same function as the `Javadoc` tool for `Java`, -but it's modern and highly pluggable. +Dokka is an API documentation engine for Kotlin. -Just like `Kotlin` itself, `Dokka` supports mixed-language projects (`Kotlin`/`Java`). It understands -[KDoc comments](https://kotlinlang.org/docs/reference/kotlin-doc.html) in `Kotlin` source files as well -as [Javadoc comments](https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html#format) in `Java` -files, and can generate documentation in multiple formats including its own `HTML` format, Java's `Javadoc` lookalike -and `Markdown`. +If you want to learn how to use Dokka, see +[documentation on kotlinlang.org](https://kotlinlang.org/docs/dokka-introduction.html). -Some libraries that use `Dokka` for API reference docs: - -* [kotlinx.coroutines](https://kotlinlang.org/api/kotlinx.coroutines/) -* [kotlinx.serialization](https://kotlinlang.org/api/kotlinx.serialization/) -* [Ktor](https://api.ktor.io/) -* [Spring Framework](https://docs.spring.io/spring-framework/docs/current/kdoc-api/) - -___ - -`Dokka` provides support for the following build systems: - -* [Gradle](user_guide/applying/gradle.md) (preferred) -* [Maven](user_guide/applying/maven.md) -* [Command line](user_guide/applying/cli.md) - -___ - -`Dokka` is also very pluggable and comes with convenient plugin and extension point API. - -You can write a plugin to support [mermaid.js](community/plugins-list.md#mermaid) diagrams, -[mathjax](community/plugins-list.md#mathjax) formulas or even write custom processing of your own tags and annotations. - -For more info, see: - -* [Sample plugin tutorial](developer_guide/plugin-development/sample-plugin-tutorial.md) -* [Community plugins](community/plugins-list.md) -* [Developer guides](developer_guide/introduction.md) +If you want to learn more about Dokka's internals and/or how to write Dokka plugins, +see [Developer guides](developer_guide/introduction.md). diff --git a/mkdocs/src/doc/docs/user_guide/applying/cli.md b/mkdocs/src/doc/docs/user_guide/applying/cli.md deleted file mode 100644 index 3b02add2..00000000 --- a/mkdocs/src/doc/docs/user_guide/applying/cli.md +++ /dev/null @@ -1,158 +0,0 @@ -# Using command line - -To run Dokka from the command line, download the [Dokka CLI runner](https://mvnrepository.com/artifact/org.jetbrains.dokka/dokka-cli). -To generate documentation, run the following command: -``` -java -jar dokka-cli.jar <arguments> -``` - -## Configuration options - -Dokka supports the following command line arguments: - -* `-outputDir` - the output directory where the documentation is generated -* `-moduleName` - (required) - module name used as a part of source set ID when declaring dependent source sets -* `-cacheRoot` - cache directory to enable package-list caching -* `-pluginsClasspath` - artifacts with Dokka plugins, separated by `;`. At least `dokka-base` and all its dependencies must be added there -* `-pluginsConfiguration` - configuration for plugins in format `fqPluginName=json^^fqPluginName=json...` -* `-offlineMode` - do not resolve package-lists online -* `-failOnWarning` - throw an exception instead of a warning -* `-globalPackageOptions` - per package options added to all source sets -* `-globalLinks` - external documentation links added to all source sets -* `-globalSrcLink` - source links added to all source sets -* `-noSuppressObviousFunctions` - don't suppress obvious functions like default `toString` or `equals` -* `-suppressInheritedMembers` - suppress all inherited members that were not overriden in a given class. Eg. using it you can suppress toString or equals functions but you can't suppress componentN or copy on data class -* `-sourceSet` - (repeatable) - configuration for a single source set. Following this argument, you can pass other arguments: - * `-sourceSetName` - source set name as a part of source set ID when declaring dependent source sets - * `-displayName` - source set name displayed in the generated documentation - * `-src` - list of source files or directories separated by `;` - * `-classpath` - list of directories or .jar files to include in the classpath (used for resolving references) separated by `;` - * `-samples` - list of directories containing sample code (documentation for those directories is not generated but declarations from them can be referenced using the `@sample` tag) separated by `;` - * `-includes` - list of files containing the documentation for the module and individual packages separated by `;` - * `-includeNonPublic` - **Deprecated**, prefer using `documentedVisibilities`. Include protected and private code - * `-documentedVisibilities` - a list of visibility modifiers (separated by `;`) that should be documented. Overrides `includeNonPublic`. Default is `PUBLIC`. Possible values: `PUBLIC`, `PRIVATE`, `PROTECTED`, `INTERNAL` (Kotlin-specific), `PACKAGE` (Java-specific package-private) - * `-skipDeprecated` - if set, deprecated elements are not included in the generated documentation - * `-reportUndocumented` - warn about undocumented members - * `-noSkipEmptyPackages` - create index pages for empty packages - * `-perPackageOptions` - list of package options in format `matchingRegex,-deprecated,-privateApi,+reportUndocumented;+visibility:PRIVATE;matchingRegex, ...`, separated by `;` - * `-links` - list of external documentation links in format `url^packageListUrl^^url2...`, separated by `;` - * `-srcLink` - mapping between a source directory and a Web site for browsing the code in format `<path>=<url>[#lineSuffix]` - * `-noStdlibLink` - disable linking to online kotlin-stdlib documentation - * `-noJdkLink` - disable linking to online JDK documentation - * `-jdkVersion` - version of JDK to use for linking to JDK JavaDoc - * `-analysisPlatform` - platform used for analysis, see the [Platforms](#platforms) section - * `-dependentSourceSets` - list of dependent source sets in format `moduleName/sourceSetName`, separated by `;` -* `-loggingLevel` - one of `DEBUG`, `PROGRESS`, `INFO`, `WARN`, `ERROR`. Defaults to `DEBUG`. Please note that this argument can't be passed in JSON. - - -You can also use a JSON file with Dokka configuration: - ``` - java -jar <dokka_cli.jar> <path_to_config.json> - ``` - -## Applying plugins -To apply a Dokka plugin you have to provide it and all its dependencies in the `pluginsClasspath` parameter - -## Base plugin - -Using CLI runner to generate default documentation requires providing all dependencies manually on classpath. -For Base plugins these are: - -* [dokka-base.jar](https://mvnrepository.com/artifact/org.jetbrains.dokka/dokka-base) -* [dokka-analysis.jar](https://mvnrepository.com/artifact/org.jetbrains.dokka/dokka-analysis) -* [kotlin-analysis-compiler.jar](https://mvnrepository.com/artifact/org.jetbrains.dokka/kotlin-analysis-compiler) -* [kotlin-analysis-intellij.jar](https://mvnrepository.com/artifact/org.jetbrains.dokka/kotlin-analysis-intellij) -* [kotlinx-html-jvm.jar](https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-html-jvm?repo=kotlinx) - -All of them are published on maven central. Another dependencies of Base plugin (e.g. `kotlinx-coroutines-core` and so on) are already included in `dokka-cli.jar`. -To get them on classpath one should add them via `pluginsClasspath` argument, e. g. -``` -java -jar dokka-cli.jar -pluginsClasspath "dokka-base.jar;dokka-analysis.jar;kotlin-analysis-compiler.jar;kotlin-analysis-intellij.jar;kotlinx-html-jvm.jar" ... -``` - -## Example using JSON - -To run Dokka with JSON configuration: -``` -java -jar dokka-cli.jar dokkaConfiguration.json -``` -Option values of JSON correspond to [Gradle ones](../../gradle/usage#configuration-options). -The content of JSON file ```dokkaConfiguration.json```: -```json -{ - "moduleName": "Dokka Example", - "moduleVersion": null, - "outputDir": "build/dokka/html", - "cacheRoot": null, - "offlineMode": false, - "sourceSets": [ - { - "displayName": "jvm", - "sourceSetID": { - "scopeId": ":dokkaHtml", - "sourceSetName": "main" - }, - "classpath": [ - "libs/kotlin-stdlib-1.7.20.jar", - "libs/kotlin-stdlib-common-1.7.20.jar" - ], - "sourceRoots": [ - "/home/Vadim.Mishenev/dokka/examples/cli/src/main/kotlin" - ], - "dependentSourceSets": [], - "samples": [], - "includes": [ - "Module.md" - ], - "includeNonPublic": false, - "documentedVisibilities": ["PUBLIC", "PRIVATE", "PROTECTED", "INTERNAL", "PACKAGE"], - "reportUndocumented": false, - "skipEmptyPackages": true, - "skipDeprecated": false, - "jdkVersion": 8, - "sourceLinks": [ - { - "localDirectory": "/home/Vadim.Mishenev/dokka/examples/cli/src/main/kotlin", - "remoteUrl": "https://github.com/Kotlin/dokka/tree/master/examples/gradle/dokka-gradle-example/src/main/kotlin", - "remoteLineSuffix": "#L" - } - ], - "perPackageOptions": [], - "externalDocumentationLinks": [ - { - "url": "https://docs.oracle.com/javase/8/docs/api/", - "packageListUrl": "https://docs.oracle.com/javase/8/docs/api/package-list" - }, - { - "url": "https://kotlinlang.org/api/latest/jvm/stdlib/", - "packageListUrl": "https://kotlinlang.org/api/latest/jvm/stdlib/package-list" - } - ], - "noStdlibLink": false, - "noJdkLink": false, - "suppressedFiles": [], - "analysisPlatform": "jvm" - } - ], - "pluginsClasspath": [ - "plugins/dokka-base-1.7.20.jar", - "libs/kotlinx-html-jvm-0.7.3.jar", - "libs/dokka-analysis-1.7.20.jar", - "libs/kotlin-analysis-intellij-1.7.20.jar", - "libs/kotlin-analysis-compiler-1.7.20.jar" - ], - "pluginsConfiguration": [ - { - "fqPluginName": "org.jetbrains.dokka.base.DokkaBase", - "serializationFormat": "JSON", - "values": "{\"separateInheritedMembers\":false,\"footerMessage\":\"© 2021 Copyright\"}" - } - ], - "modules": [], - "failOnWarning": false, - "delayTemplateSubstitution": false, - "suppressObviousFunctions": true, - "includes": [], - "suppressInheritedMembers": false -} -``` diff --git a/mkdocs/src/doc/docs/user_guide/applying/gradle.md b/mkdocs/src/doc/docs/user_guide/applying/gradle.md deleted file mode 100644 index 60ede7b9..00000000 --- a/mkdocs/src/doc/docs/user_guide/applying/gradle.md +++ /dev/null @@ -1,380 +0,0 @@ -# Using the Gradle plugin - -!!! important - If you are upgrading from 0.10.x to a current release of Dokka, please have a look at our - [migration guide](https://github.com/Kotlin/dokka/blob/master/runners/gradle-plugin/MIGRATION.md) - -### Supported versions -Dokka should work on gradle newer than 5.6 - -### Setup - -The preferred way is to use `plugins` block. - -build.gradle.kts: -```kotlin -plugins { - id("org.jetbrains.dokka") version "1.7.20" -} - -repositories { - mavenCentral() -} -``` - -You can also use the legacy plugin application method with `buildscript` block. -Note that by using the `buildscript` way type-safe accessors are not available in Gradle Kotlin DSL, -eg. you'll have to use `named<DokkaTask>("dokkaHtml")` instead of `dokkaHtml`: - -```kotlin -buildscript { - dependencies { - classpath("org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}") - } -} - -apply(plugin="org.jetbrains.dokka") -``` - -The plugin adds `dokkaHtml`, `dokkaJavadoc`, `dokkaGfm` and `dokkaJekyll` tasks to the project. - -Each task corresponds to one output format, so you should run `dokkaGfm` when you want to have a documentation in `GFM` format. -Output formats are explained in [the introduction](../introduction.md#output-formats) - -If you encounter any problems when migrating from older versions of Dokka, please see the [FAQ](https://github.com/Kotlin/dokka/wiki/faq). - -Minimal configuration (with custom output directory only): - -Kotlin DSL -```kotlin -tasks.dokkaHtml.configure { - outputDirectory.set(buildDir.resolve("dokka")) -} -``` - - -Groovy DSL -```groovy -dokkaHtml { - outputDirectory.set(file("${buildDir}/dokka")) -} -``` - -!!! note - Dokka extracts the information about sourcesets from the Kotlin Gradle plugin. - Therefore, 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 a depencency to the Kotlin Gradle Plugin as well - (`implementation(kotlin("gradle-plugin", "<kotlin-version>"))` resp. `implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:<kotlin-version>")`). - -## Configuration options - -Dokka documents single-platform as well as multi-platform projects. -Most of the configuration options are set per one source set. -The available configuration options are shown below: - -```kotlin -import org.jetbrains.dokka.DokkaConfiguration -import org.jetbrains.dokka.gradle.DokkaTask - -val dokkaHtml by getting(DokkaTask::class) { - outputDirectory.set(buildDir.resolve("dokka")) - - // Set module name displayed in the final output - moduleName.set("moduleName") - - // Use default or set to custom path to cache directory - // to enable package-list caching - // When this is set to default, caches are stored in $USER_HOME/.cache/dokka - cacheRoot.set(file("default")) - - // Suppress obvious functions like default toString or equals. Defaults to true - suppressObviousFunctions.set(false) - - // Suppress all inherited members that were not overriden in a given class. - // Eg. using it you can suppress toString or equals functions but you can't suppress componentN or copy on data class. To do that use with suppressObviousFunctions - // Defaults to false - suppressInheritedMembers.set(true) - - // Used to prevent resolving package-lists online. When this option is set to true, only local files are resolved - offlineMode.set(false) - - dokkaSourceSets { - configureEach { // Or source set name, for single-platform the default source sets are `main` and `test` - - // Used when configuring source sets manually for declaring which source sets this one depends on - dependsOn("otherSourceSetName") - - // Used to remove a source set from documentation, test source sets are suppressed by default - suppress.set(false) - - // Deprecated. Prefer using documentedVisibilities. - includeNonPublic.set(false) - - // A set of visibility modifiers that should be documented - // If set by user, overrides includeNonPublic. Default is PUBLIC - documentedVisibilities.set( - setOf( - DokkaConfiguration.Visibility.PUBLIC, // Same for both Kotlin and Java - DokkaConfiguration.Visibility.PRIVATE, // Same for both Kotlin and Java - DokkaConfiguration.Visibility.PROTECTED, // Same for both Kotlin and Java - DokkaConfiguration.Visibility.INTERNAL, // Kotlin-specific internal modifier - DokkaConfiguration.Visibility.PACKAGE, // Java-specific package-private visibility - ) - ) - - // Do not output deprecated members. Applies globally, can be overridden by packageOptions - skipDeprecated.set(false) - - // Emit warnings about not documented members. Applies globally, also can be overridden by packageOptions - reportUndocumented.set(true) - - // Do not create index pages for empty packages - skipEmptyPackages.set(true) - - // This name will be shown in the final output - displayName.set("JVM") - - // Platform used for code analysis. See the "Platforms" section of this readme - platform.set(org.jetbrains.dokka.Platform.jvm) - - // Property used for manual addition of files to the classpath - // This property does not override the classpath collected automatically but appends to it - classpath.from(file("libs/dependency.jar")) - - // List of files with module and package documentation - // https://kotlinlang.org/docs/reference/dokka-module-and-package-docs.html - includes.from("packages.md", "extra.md") - - // List of files or directories containing sample code (referenced with @sample tags) - samples.from("samples/basic.kt", "samples/advanced.kt") - - // By default, sourceRoots are taken from Kotlin Plugin and kotlinTasks, following roots will be appended to them - // Repeat for multiple sourceRoots - sourceRoots.from(file("src")) - - // Specifies the location of the project source code on the Web. - // If provided, Dokka generates "source" links for each declaration. - // Repeat for multiple mappings - sourceLink { - // Unix based directory relative path to the root of the project (where you execute gradle respectively). - localDirectory.set(file("src/main/kotlin")) - - // URL showing where the source code can be accessed through the web browser - remoteUrl.set(java.net.URL( - "https://github.com/cy6erGn0m/vertx3-lang-kotlin/blob/master/src/main/kotlin")) - // Suffix which is used to append the line number to the URL. Use #L for GitHub - remoteLineSuffix.set("#L") - } - - // Used for linking to JDK documentation - jdkVersion.set(8) - - // Disable linking to online kotlin-stdlib documentation - noStdlibLink.set(false) - - // Disable linking to online JDK documentation - noJdkLink.set(false) - - // Disable linking to online Android documentation (only applicable for Android projects) - noAndroidSdkLink.set(false) - - // Allows linking to documentation of the project"s dependencies (generated with Javadoc or Dokka) - // Repeat for multiple links - externalDocumentationLink { - // Root URL of the generated documentation to link with. The trailing slash is required! - url.set(URL("https://example.com/docs/")) - - // If package-list file is located in non-standard location - // packageListUrl = URL("file:///home/user/localdocs/package-list") - } - - // Allows to customize documentation generation options on a per-package basis - // Repeat for multiple packageOptions - // If multiple packages match the same matchingRegex, the longest matchingRegex will be used - perPackageOption { - // will match kotlin and all sub-packages of it - matchingRegex.set("kotlin($|\\.).*") - - // All options are optional - skipDeprecated.set(false) - reportUndocumented.set(true) // Emit warnings about not documented members - includeNonPublic.set(false) // Deprecated, prefer using documentedVisibilities - - // Visibilities that should be included in the documentation - // If set by user, overrides includeNonPublic. Default is PUBLIC - documentedVisibilities.set( - setOf( - DokkaConfiguration.Visibility.PUBLIC, // Same for both Kotlin and Java - DokkaConfiguration.Visibility.PRIVATE, // Same for both Kotlin and Java - DokkaConfiguration.Visibility.PROTECTED, // Same for both Kotlin and Java - DokkaConfiguration.Visibility.INTERNAL, // Kotlin-specific internal modifier - DokkaConfiguration.Visibility.PACKAGE, // Java-specific package-private visibility - ) - ) - } - // Suppress a package - perPackageOption { - matchingRegex.set(""".*\.internal.*""") // will match all .internal packages and sub-packages - suppress.set(true) - } - - // Include generated files in documentation - // By default Dokka will omit all files in folder named generated that is a child of buildDir - suppressGeneratedFiles.set(false) - } - // Configures a plugin separately from the global configuration - pluginConfiguration<PluginClass, ConfigurationClass>{ - // values - } - } -} -``` - -## Multiplatform -Dokka supports single-platform and multi-platform projects using source sets abstraction. For most mutli-platform projects -you should assume that Dokka's source sets correspond to Kotlin plugin's source sets. All source sets are by default registered -and configured automatically although test source sets are suppressed - -Kotlin -```kotlin -kotlin { // Kotlin Multiplatform plugin configuration - jvm() - js("customName") -} - -tasks.withType<DokkaTask>().configureEach { - // custom output directory - outputDirectory.set(buildDir.resolve("dokka")) - - dokkaSourceSets { - named("customNameMain") { // The same name as in Kotlin Multiplatform plugin, so the sources are fetched automatically - includes.from("packages.md", "extra.md") - samples.from("samples/basic.kt", "samples/advanced.kt") - } - - register("differentName") { // Different name, so source roots must be passed explicitly - displayName.set("JVM") - platform.set(org.jetbrains.dokka.Platform.jvm) - sourceRoots.from(kotlin.sourceSets.getByName("jvmMain").kotlin.srcDirs) - sourceRoots.from(kotlin.sourceSets.getByName("commonMain").kotlin.srcDirs) - } - } -} -``` - -!!! note - If you want to share the configuration between source sets, you can use Gradle's `configureEach` - -## Applying plugins -Dokka plugin creates Gradle configuration for each output format in the form of `dokka${format}Plugin` (or `dokka${format}PartialPlugin` for multi-module tasks) : - -```kotlin -dependencies { - dokkaHtmlPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:1.7.20") -} -``` - -You can also create a custom Dokka task and add plugins directly inside: - -```kotlin -val customDokkaTask by creating(DokkaTask::class) { - dependencies { - plugins("org.jetbrains.dokka:kotlin-as-java-plugin:1.7.20") - } -} -``` - -!!! important - Please note that `dokkaJavadoc` task will properly document only single `jvm` source set - -To generate the documentation, use the appropriate `dokka${format}` Gradle task: - -```bash -./gradlew dokkaHtml -``` - -Some plugins can be configured separately using a plugin class and configuration class. For example: - -```kotlin -import org.jetbrains.dokka.base.DokkaBase -import org.jetbrains.dokka.base.DokkaBaseConfiguration - -pluginConfiguration<DokkaBase, DokkaBaseConfiguration> { - customAssets = listOf(file("<path to asset>")) - customStyleSheets = listOf(file("<path to custom stylesheet>")) -} -``` - -Keep in mind, that this only works when using a buildscript (with the configured plugin on classpath) since it is not possible to import plugin's class without it. -For example, you can add `DokkaBase` to gain access to aforementioned configuration: - -```kotlin -buildscript { - dependencies { - // classpath("<plugin coordinates>:<plugin version>") - classpath("org.jetbrains.dokka:dokka-base:1.7.20") - } -} -``` - -If you don't want to use a buildscript or use Kotlin version lower than 1.3.50 you can achieve the same behaviour manually: -```kotlin -pluginsMapConfiguration.set(mapOf("<fully qualified plugin's name>" to """<json configuration>""")) -``` -## Android - -!!! important - Make sure you apply Dokka after `com.android.library` and `kotlin-android`. - -```kotlin -buildscript { - dependencies { - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}") - classpath("org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}") - } -} -repositories { - mavenCentral() -} -apply(plugin= "com.android.library") -apply(plugin= "kotlin-android") -apply(plugin= "org.jetbrains.dokka") -``` - -```kotlin -dokkaHtml.configure { - dokkaSourceSets { - named("main") { - noAndroidSdkLink.set(false) - } - } -} -``` - -## Multi-module projects -For documenting Gradle multi-module projects, you can use `dokka${format}MultiModule` tasks. -Dokka plugin adds `dokkaHtmlMultiModule`, `dokkaGfmMultiModule` and `dokkaJekyllMultiModule` tasks to -all Gradle parent projects (all projects that have some child projects) as well as -`dokkaHtmlPartial`, `dokkaGfmPartial` and `dokkaJekyllPartial` to all projects that have a parent. -If you want eg. to add an external link to some dependency you should do so in respective `dokka${format}Partial` tasks, -or configure them all at once using the `subprojects` block and `configureEach` method. - -```kotlin -tasks.dokkaHtmlMultiModule.configure { - outputDirectory.set(buildDir.resolve("dokkaCustomMultiModuleOutput")) -} -``` - -`DokkaMultiModule` depends on all Dokka tasks in the subprojects named `dokka${format}Partial`, runs them, and creates a top-level page -with links to all generated (sub)documentations. It is possible to configure each of them: -```kotlin -tasks.dokkaHtmlPartial.configure { - failOnWarning.set(true) -} -``` - -## Example projects - -Please see the [Dokka Gradle single module example project](https://github.com/Kotlin/dokka/tree/master/examples/gradle/dokka-gradle-example) or [multimodule](https://github.com/Kotlin/dokka/tree/master/examples/gradle/dokka-multimodule-example) for an example. - -Also see [generated documentation](https://Kotlin.github.io/dokka/examples/dokka-gradle-example/html) in `HTML` format. diff --git a/mkdocs/src/doc/docs/user_guide/applying/maven.md b/mkdocs/src/doc/docs/user_guide/applying/maven.md deleted file mode 100644 index 3ea6a56f..00000000 --- a/mkdocs/src/doc/docs/user_guide/applying/maven.md +++ /dev/null @@ -1,243 +0,0 @@ -# Using the Maven plugin - -!!! note - Dokka Maven plugin does not support multi-platform projects. - -Minimal Maven configuration is - -```xml -<plugin> - <groupId>org.jetbrains.dokka</groupId> - <artifactId>dokka-maven-plugin</artifactId> - <version>${dokka.version}</version> - <executions> - <execution> - <phase>pre-site</phase> - <goals> - <goal>dokka</goal> - </goals> - </execution> - </executions> -</plugin> -``` - -By default files will be generated in `target/dokka`. - -The following goals are provided by the plugin: - -* `dokka:dokka` - generate HTML documentation in Dokka format (showing declarations in Kotlin syntax) -* `dokka:javadoc` - generate HTML documentation in Javadoc format (showing declarations in Java syntax) -* `dokka:javadocJar` - generate a .jar file with Javadoc format documentation - -## Configuration options - -The available configuration options are shown below: - -```xml -<plugin> - <groupId>org.jetbrains.dokka</groupId> - <artifactId>dokka-maven-plugin</artifactId> - <version>${dokka.version}</version> - <executions> - <execution> - <phase>pre-site</phase> - <goals> - <goal>dokka</goal> - </goals> - </execution> - </executions> - <configuration> - - <!-- Set to true to skip dokka task, default: false --> - <skip>false</skip> - - <!-- Default: ${project.artifactId} --> - <moduleName>data</moduleName> - - <!-- Default: ${project.basedir}/target/dokka --> - <outputDir>some/out/dir</outputDir> - - <!-- Use default or set to custom path to cache directory to enable package-list caching. --> - <!-- When set to default, caches stored in $USER_HOME/.cache/dokka --> - <cacheRoot>default</cacheRoot> - - <!-- Set to true to to prevent resolving package-lists online. --> - <!-- When this option is set to true, only local files are resolved, default: false --> - <offlineMode>false</offlineMode> - - <!-- List of '.md' files with package and module docs --> - <!-- https://kotlinlang.org/docs/reference/dokka-module-and-package-docs.html --> - <includes> - <include>packages.md</include> - <include>extra.md</include> - </includes> - - <!-- A list of visibility modifiers that should be documented --> - <!-- If set by user, overrides includeNonPublic. Default is PUBLIC --> - <documentedVisibilities> - <visibility>PUBLIC</visibility> <!-- Same for both kotlin and java --> - <visibility>PRIVATE</visibility> <!-- Same for both kotlin and java --> - <visibility>PROTECTED</visibility> <!-- Same for both kotlin and java --> - <visibility>INTERNAL</visibility> <!-- Kotlin-specific internal modifier --> - <visibility>PACKAGE</visibility> <!-- Java-specific package-private visibility (default) --> - </documentedVisibilities> - - <!-- List of sample roots --> - <samples> - <dir>src/test/samples</dir> - </samples> - - <!-- Suppress obvious functions like default toString or equals. Defaults to true --> - <suppressObviousFunctions>false</suppressObviousFunctions> - - <!-- Suppress all inherited members that were not overriden in a given class. --> - <!-- Eg. using it you can suppress toString or equals functions but you can't suppress componentN or copy on data class. To do that use with suppressObviousFunctions --> - <!-- Defaults to false --> - <suppressInheritedMembers>true</suppressInheritedMembers> - - <!-- Used for linking to JDK, default: 6 --> - <jdkVersion>6</jdkVersion> - - <!-- Do not output deprecated members, applies globally, can be overridden by packageOptions --> - <skipDeprecated>false</skipDeprecated> - <!-- Emit warnings about not documented members, applies globally, also can be overridden by packageOptions --> - <reportUndocumented>true</reportUndocumented> - <!-- Do not create index pages for empty packages --> - <skipEmptyPackages>true</skipEmptyPackages> - - <!-- Short form list of sourceRoots, by default, set to ${project.compileSourceRoots} --> - <sourceDirectories> - <dir>src/main/kotlin</dir> - </sourceDirectories> - - <!-- Full form list of sourceRoots --> - <sourceRoots> - <root> - <path>src/main/kotlin</path> - <!-- See platforms section of documentation --> - <platforms>JVM</platforms> - </root> - </sourceRoots> - - <!-- Specifies the location of the project source code on the Web. If provided, Dokka generates "source" links - for each declaration. --> - <sourceLinks> - <link> - <!-- Source directory --> - <path>${project.basedir}/src/main/kotlin</path> - <!-- URL showing where the source code can be accessed through the web browser --> - <url>https://github.com/cy6erGn0m/vertx3-lang-kotlin/blob/master/src/main/kotlin</url> <!-- //remove src/main/kotlin if you use "./" above --> - <!--Suffix which is used to append the line number to the URL. Use #L for GitHub --> - <lineSuffix>#L</lineSuffix> - </link> - </sourceLinks> - - <!-- Disable linking to online kotlin-stdlib documentation --> - <noStdlibLink>false</noStdlibLink> - - <!-- Disable linking to online JDK documentation --> - <noJdkLink>false</noJdkLink> - - <!-- Allows linking to documentation of the project's dependencies (generated with Javadoc or Dokka) --> - <externalDocumentationLinks> - <link> - <!-- Root URL of the generated documentation to link with. The trailing slash is required! --> - <url>https://example.com/docs/</url> - <!-- If package-list file located in non-standard location --> - <!-- <packageListUrl>file:///home/user/localdocs/package-list</packageListUrl> --> - </link> - </externalDocumentationLinks> - - <!-- Allows to customize documentation generation options on a per-package basis --> - <perPackageOptions> - <packageOptions> - <!-- Will match kotlin and all sub-packages of it --> - <matchingRegex>kotlin($|\.).*</matchingRegex> - - <!-- All options are optional, default values are below: --> - <skipDeprecated>false</skipDeprecated> - - <!-- Emit warnings about not documented members --> - <reportUndocumented>true</reportUndocumented> - - <!-- Deprecated. Prefer using documentedVisibilities --> - <includeNonPublic>false</includeNonPublic> - - <!-- A list of visibility modifiers that should be documented --> - <!-- If set by user, overrides includeNonPublic. Default is PUBLIC --> - <documentedVisibilities> - <visibility>PUBLIC</visibility> <!-- Same for both kotlin and java --> - <visibility>PRIVATE</visibility> <!-- Same for both kotlin and java --> - <visibility>PROTECTED</visibility> <!-- Same for both kotlin and java --> - <visibility>INTERNAL</visibility> <!-- Kotlin-specific internal modifier --> - <visibility>PACKAGE</visibility> <!-- Java-specific package-private visibility (default) --> - </documentedVisibilities> - </packageOptions> - </perPackageOptions> - - <!-- Allows to use any dokka plugin, eg. GFM format --> - <dokkaPlugins> - <plugin> - <groupId>org.jetbrains.dokka</groupId> - <artifactId>gfm-plugin</artifactId> - <version>${dokka.version}</version> - </plugin> - </dokkaPlugins> - - <!-- Configures a plugin separately --> - <pluginsConfiguration> - <fullyQualifiedPluginName> - <!-- Configuration --> - </fullyQualifiedPluginName> - </pluginsConfiguration> - - </configuration> -</plugin> -``` - -## Applying plugins -You can add plugins inside the `dokkaPlugins` block: - -```xml -<plugin> - <groupId>org.jetbrains.dokka</groupId> - <artifactId>dokka-maven-plugin</artifactId> - <version>${dokka.version}</version> - <executions> - <execution> - <phase>pre-site</phase> - <goals> - <goal>dokka</goal> - </goals> - </execution> - </executions> - <configuration> - <dokkaPlugins> - <plugin> - <groupId>org.jetbrains.dokka</groupId> - <artifactId>kotlin-as-java-plugin</artifactId> - <version>${dokka.version}</version> - </plugin> - </dokkaPlugins> - </configuration> -</plugin> -``` - -Some plugins can be configured separately using plugin's fully qualified name. For example: - -```xml -<pluginsConfiguration> - <org.jetbrains.dokka.base.DokkaBase> - <customStyleSheets> - <customStyleSheet><!-- path to custom stylesheet --></customStyleSheet> - </customStyleSheets> - <customAssets> - <customAsset><!-- path to custom asset --></customAsset> - </customAssets> - </org.jetbrains.dokka.base.DokkaBase> -</pluginsConfiguration> -``` - -## Example project - -Please see the [Dokka Maven example project](https://github.com/Kotlin/dokka/tree/master/examples/maven) for an example. diff --git a/mkdocs/src/doc/docs/user_guide/introduction.md b/mkdocs/src/doc/docs/user_guide/introduction.md deleted file mode 100644 index cb263ebe..00000000 --- a/mkdocs/src/doc/docs/user_guide/introduction.md +++ /dev/null @@ -1,74 +0,0 @@ -# Introduction - -## Plugins -Dokka can be customized with plugins. Each output format is internally a plugin. -Additionally, `kotlin-as-java` plugin can be used to generate documentation as seen from Java perspective. -Currently maintained plugins are: - -* `dokka-base` - the main plugin needed to run Dokka, contains html format -* `gfm-plugin` - configures `GFM` output format -* `jekyll-plugin` - configures `Jekyll` output format -* `javadoc-plugin` - configures `Javadoc` output format, automatically applies `kotlin-as-java-plugin` -* `kotlin-as-java-plugin` - translates Kotlin definitions to Java -* `android-documentation-plugin` - provides android specific enhancements like `@hide` support - -Please see the usage instructions for each build system on how to add plugins to Dokka. - -## Source sets -Dokka generates documentation based on source sets. - -For single-platform & multi-platform projects, source sets are the same as in Kotlin plugin: - - * One source set for each platform, eg. `jvmMain` or `jsMain`; - * One source set for each common source set, eg. the default `commonMain` and custom ones like `jsAndJvmMain`. - -When configuring multi-platform projects manually (eg. in the CLI or in Gradle without the Kotlin Gradle Plugin) -source sets must declare their dependent source sets. -Eg. in the following Kotlin plugin configuration: - -* `jsMain` and `jvmMain` both depend on `commonMain` (by default and transitively) and `jsAndJvmMain`; -* `linuxX64Main` only depends on `commonMain`. - -```kotlin -kotlin { // Kotlin plugin configuration - jvm() - js() - linuxX64() - - sourceSets { - val commonMain by getting {} - val jvmAndJsSecondCommonMain by creating { dependsOn(commonMain) } - val jvmMain by getting { dependsOn(jvmAndJsSecondCommonMain) } - val jsMain by getting { dependsOn(jvmAndJsSecondCommonMain) } - val linuxX64Main by getting { dependsOn(commonMain) } - } -} -``` - -## Output formats - Dokka documents Java classes as seen in Kotlin by default, with javadoc format being the only exception. - - * `html` - HTML format used by default - * `javadoc` - looks like JDK's Javadoc, Kotlin classes are translated to Java - * `gfm` - GitHub flavored markdown - * `jekyll` - Jekyll compatible markdown - -If you want to generate the documentation as seen from Java perspective, you can add the `kotlin-as-java` plugin -to the Dokka plugins classpath, eg. in Gradle: - -```kotlin -dependencies{ - implementation("...") - dokkaGfmPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:${dokka-version}") -} -``` - -## Platforms - -Each Dokka source set is analyzed for a specific platform. The platform should be extracted automatically from the Kotlin plugin. -In case of a manual source set configuration, you have to select one of the following: - - * `jvm` - * `js` - * `native` - * `common` diff --git a/mkdocs/src/doc/docs/user_guide/output-formats/html.md b/mkdocs/src/doc/docs/user_guide/output-formats/html.md deleted file mode 100644 index 9a80a5d2..00000000 --- a/mkdocs/src/doc/docs/user_guide/output-formats/html.md +++ /dev/null @@ -1,112 +0,0 @@ -# Configuration specific to HTML format - -## Prerequisites - -Dokka's HTML format requires a web server to view documentation correctly. -This can be achieved by using the one that is build in IntelliJ or providing your own. -If this requisite is not fulfilled Dokka with fail to load navigation pane and search bars. - -!!! important - Concepts specified below apply only to configuration of the Base Plugin (that contains HTML format) - and needs to be applied via pluginsConfiguration and not on the root one. - -## Modifying assets - -It is possible to change static assets that are used to generate dokka's HTML. -Currently, user can modify: - - * customAssets - * customStyleSheets - -Every file provided in those values will be applied to **every** page. - -Dokka uses 4 stylesheets: - -* `style.css` - main css file responsible for styling the page -* `jetbrains-mono.css` - fonts used across dokka -* `logo-styles.css` - logo styling -* [`prism.css`](https://github.com/Kotlin/dokka/blob/master/plugins/base/src/main/resources/dokka/styles/prism.css) - code highlighting - -Also, it uses js scripts. The actual ones are [here](https://github.com/Kotlin/dokka/tree/master/plugins/base/src/main/resources/dokka/scripts). -User can choose to add or override those files - stylesheets and js scripts. -Resources will be overridden when in `pluginConfiguration` block there is a resource with the same name. - -## Modifying footer - -Dokka supports custom messages in the footer via `footerMessage` string property on base plugin configuration. -Keep in mind that this value will be passed exactly to the output HTML, so it has to be valid and escaped correctly. - -## Separating inherited members - -By setting a boolean property `separateInheritedMembers` dokka will split inherited members (like functions, properties etc.) -from ones declared in viewed class. Separated members will have it's own tabs on the page. - -## Merging declarations with name clashing - -By setting a boolean property `mergeImplicitExpectActualDeclarations` dokka will merge declarations that do not have `expect`/`actual` keywords but have the same fully qualified name. -The declarations will be displayed on one page. -By default, it is disabled. The page names of such declaration have a prefix that is the name of source set. - -### Examples -In order to override a logo and style it accordingly a css file named `logo-styles.css` is needed: -```css -.library-name a { - position: relative; - --logo-width: 100px; - margin-left: calc(var(--logo-width) + 5px); -} - -.library-name a::before { - content: ''; - background: url("https://upload.wikimedia.org/wikipedia/commons/9/9d/Ubuntu_logo.svg") center no-repeat; - background-size: contain; - position: absolute; - width: var(--logo-width); - height: 50px; - top: -18px; - left: calc(-1 * var(--logo-width) - 5px); - /* other styles required to make your page pretty */ -} -``` - - -For build system specific instructions please visit dedicated pages: [gradle](../applying/gradle.md#applying-plugins), [maven](../applying/maven.md#applying-plugins) and [cli](../applying/cli.md#configuration-options) - -## Custom HTML pages - -Templates are taken from the folder that is defined by the `templatesDir` property. -To customize HTML output, you can use the [default template](https://github.com/Kotlin/dokka/blob/master/plugins/base/src/main/resources/dokka/templates) as a starting point. - -!!! note - To change page assets, you can set properties `customAssets` and `customStyleSheets`. - Assets are handled by Dokka itself, not FreeMaker. - -There is a template file with predefined name `base.ftl`. It defines general design of all pages to render. -`base.ftl` can import another templates that can be set by user as well: - -* `includes/header.ftl` -* `includes/footer.ftl` -* `includes/page_metadata.ftl` -* `includes/source_set_selector.ftl`. - -If `templatesDir` is defined, Dokka will find a template file there. -If the file is not found, a default one will be used. - -Variables given below are available to the template: - -* `${pageName}` - the page name -* `${footerMessage}` - text that is set by the `footerMessage` property -* `${sourceSets}` - a nullable list of source sets, only for multi-platform pages. Each source set has `name`, `platfrom` and `filter` properties. - -Also, Dokka-defined [directives](https://freemarker.apache.org/docs/ref_directive_userDefined.html) can be used: - -* `<@content/>` - main content -* `<@resources/>` - scripts, stylesheets -* `<@version/>` - version ([versioning-plugin](../plugins/versioning-plugin.md) will replace this with a version navigator) -* `<@template_cmd name="...""> ...</@template_cmd>` - is used for variables that depend on the root project (such `pathToRoot`, `projectName`). They are available only inside the directive. This is processed by a multi-module task that assembles partial outputs from modules. - Example: - ``` - <@template_cmd name="projectName"> - <span>${projectName}</span> - </@template_cmd> - ``` diff --git a/mkdocs/src/doc/docs/user_guide/plugins/android-plugin.md b/mkdocs/src/doc/docs/user_guide/plugins/android-plugin.md deleted file mode 100644 index d52c2e5a..00000000 --- a/mkdocs/src/doc/docs/user_guide/plugins/android-plugin.md +++ /dev/null @@ -1,8 +0,0 @@ -# Android documentation plugin - -Android documentation plugin aims to improve the documentation on android platform. - -### Features: - -* `@hide` support - `@hide` javadoc tag is an equivalent of `@suppress` tag in kdoc. It hides certain entry from being - displayed in the documentation. diff --git a/mkdocs/src/doc/docs/user_guide/plugins/versioning-plugin.md b/mkdocs/src/doc/docs/user_guide/plugins/versioning-plugin.md deleted file mode 100644 index 876ec436..00000000 --- a/mkdocs/src/doc/docs/user_guide/plugins/versioning-plugin.md +++ /dev/null @@ -1,86 +0,0 @@ -# Versioning plugin - -Versioning plugin aims to provide users with ability to create a versioned documentation. -Therefore, users of the documentation can view different versions of the documentation by going to the main page and change versions. - -Versioning can be configured using: - -* version - a string value representing a version that should be displayed in the dropdown. -* olderVersionsDir - an optional file that represents the parent directory containing folders with previous Dokka outputs. -* olderVersions - an optional list of directories, each containing a previous Dokka output. Used after the contents of - `olderVersionsDir` - (if it's specified). -* versionsOrdering - an optional list of strings representing the ordering of versions that should be visible. - By default, Dokka will try to use semantic versioning to create such ordering. -* renderVersionsNavigationOnAllPages - a bool value. - By default, Dokka renders a versions navigation on all pages. - -!!! note - You should enable the plugin in all submodules to render a versions navigation on all pages. - -Above configuration should be placed under the `pluginsConfiguration` block specific for your build tool. -Configuration object is named `org.jetbrains.dokka.versioning.VersioningConfiguration`. - - -### Directory structure required - -If you pass previous versions using `olderVersionsDir`, a particular directory structure is required: - -``` -. -└── older_versions_dir - └── 1.4.10 - ├── <dokka output> - └── 1.4.20 - ├── <dokka output> - ... -``` - -As can be seen on the diagram, `olderVersionsDir` should be a parent directory of previous output directories. - -This can be avoided by manually specifying each past output directory with `olderVersions`, or they can be used -together. - -`olderVersions` directories need to contain a past Dokka output. For the above example, you would pass -`older_versions_dir/1.4.10, older_versions_dir/1.4.20`. - -!!! note - The previously documentations should be generated with the versioning plugin. - -### Example - -Versioning plugin in gradle can be configured in 2 ways: - -* by manually adding the versioning plugin to classpath and using `pluginsConfiguration` - -* by using `pluginsMapConfiguration` and adding the configuration serialized as json under the `org.jetbrains.dokka.versioning.VersioningPlugin` key. - - -If you choose the first method the configuration may look like this: - -```kotlin -buildscript { - dependencies { - classpath("org.jetbrains.dokka:versioning-plugin:<dokka_version>") - } -} - -... - -pluginConfiguration<org.jetbrains.dokka.versioning.VersioningPlugin, org.jetbrains.dokka.versioning.VersioningConfiguration> { - version = "1.0" - olderVersionsDir = projectDir.resolve("olderVersionsDir") -} -``` - -Alternatively, without adding plugin to classpath: - -```kotlin -pluginsMapConfiguration.set(mapOf("org.jetbrains.dokka.versioning.VersioningPlugin" to """{ "version": "1.0" }""")) -``` - -Please consult the [Gradle documentation](../applying/gradle.md#applying-plugins) for more information about configuring Dokka with this build tool. - -Please see the [Dokka Gradle versioning multi modules example project](https://github.com/Kotlin/dokka/tree/master/examples/gradle/dokka-versioning-multimodule-example). - -Also see the [generated documentation](https://Kotlin.github.io/dokka/examples/dokka-versioning-multimodule-example/htmlMultiModule). diff --git a/mkdocs/src/doc/mkdocs.yml b/mkdocs/src/doc/mkdocs.yml index d8aba618..0b520944 100644 --- a/mkdocs/src/doc/mkdocs.yml +++ b/mkdocs/src/doc/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Dokka documentation +site_name: Dokka # Meta tags (placed in header) site_description: Dokka is an API documentation engine for Kotlin, performing the same function as the Javadoc tool for Java @@ -8,10 +8,10 @@ site_url: https://github.com/Kotlin/dokka # Repository (add link to repository on each page) repo_name: dokka repo_url: https://github.com/Kotlin/dokka -edit_uri: edit/master/docs/src/doc/docs/ +edit_uri: edit/master/mkdocs/src/doc/docs/ # Copyright (shown at the footer) -copyright: 'Copyright © 2022 JetBrains' +copyright: 'Copyright © 2023 JetBrains' # Material theme theme: @@ -51,27 +51,17 @@ markdown_extensions: class: mermaid format: !!python/name:pymdownx.superfences.fence_code_format -# Dev server binding -#dev_addr: 127.0.0.1:3001 +# Dev server binding for livereload +dev_addr: 127.0.0.1:3001 nav: - Home: - index.md - - User guides: user_guide/introduction.md + - User guides: https://kotlinlang.org/docs/dokka-introduction.html - Developer guides: developer_guide/introduction.md - Community: community/slack.md - - FAQ: faq.md - User guides: - - User guides: user_guide/introduction.md - - Applying Dokka: - - Gradle: user_guide/applying/gradle.md - - Maven: user_guide/applying/maven.md - - Command line: user_guide/applying/cli.md - - Output formats: - - HTML: user_guide/output-formats/html.md - - Plugins: - - Versioning plugin: user_guide/plugins/versioning-plugin.md - - Android plugin: user_guide/plugins/android-plugin.md + - https://kotlinlang.org/docs/dokka-introduction.html - Developer guides: - Developer guides: developer_guide/introduction.md - Workflow: developer_guide/workflow.md @@ -90,8 +80,6 @@ nav: - Sample plugin tutorial: developer_guide/plugin-development/sample-plugin-tutorial.md - Community: - Slack: community/slack.md - - Community plugins: community/plugins-list.md - - FAQ: faq.md extra_css: - dokka_colors.css |