diff options
author | Ignat Beresnev <ignat.beresnev@jetbrains.com> | 2023-01-19 04:10:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-19 04:10:57 +0100 |
commit | 5eeb2bbeb8c71ae813808ee0e8d09293c4abe1c1 (patch) | |
tree | bb62ab50a59cbeca06de6fd1eb5c75ff27bc5bd0 /examples/gradle/dokka-customFormat-example | |
parent | 1fa8552994fb292729eca8c0de6a1561380b008c (diff) | |
download | dokka-5eeb2bbeb8c71ae813808ee0e8d09293c4abe1c1.tar.gz dokka-5eeb2bbeb8c71ae813808ee0e8d09293c4abe1c1.tar.bz2 dokka-5eeb2bbeb8c71ae813808ee0e8d09293c4abe1c1.zip |
Revise README documentation for examples and plugins (#2736)
Diffstat (limited to 'examples/gradle/dokka-customFormat-example')
-rw-r--r-- | examples/gradle/dokka-customFormat-example/README.md | 23 | ||||
-rw-r--r-- | examples/gradle/dokka-customFormat-example/build.gradle.kts | 12 | ||||
-rw-r--r-- | examples/gradle/dokka-customFormat-example/demo.png | bin | 0 -> 77918 bytes |
3 files changed, 15 insertions, 20 deletions
diff --git a/examples/gradle/dokka-customFormat-example/README.md b/examples/gradle/dokka-customFormat-example/README.md index 00dd668c..a25cd80e 100644 --- a/examples/gradle/dokka-customFormat-example/README.md +++ b/examples/gradle/dokka-customFormat-example/README.md @@ -1,24 +1,17 @@ ## Dokka custom format example -This example demonstrates a few things: +This example demonstrates how to override `.css` styles and add custom images as assets, allowing +you to change the logo used in the header. -1. How to override css styles and add custom images. -2. How to change logo used in the header. -3. How to register a custom `Dokka` task with its own independent configuration. +You can see up-to-date documentation generated for this example on +[GitHub Pages](https://kotlin.github.io/dokka/examples/dokka-customFormat-example/html/index.html). -### Running +![screenshot demonstration of output](demo.png) -`dokkaCustomFormat` task has been created in the buildscript of this example project with a few configuration changes. +### Running -In order to see the full effect of these changes, run `dokkaCustomFormat` task from your IDE or execute -the following command: +Run `dokkaHtml` task to generate documentation with the custom logo in place: ```bash -./gradlew clean dokkaCustomFormat +./gradlew dokkaHtml ``` - ---- - -If you run any other `Dokka` task, such as `dokkaHtml`, you'll see vanilla `Dokka` without any alterations. -This is because changes to configuration are applied only within `dokkaCustomFormat` task. This can be useful -if you want to generate multiple versions of documentation with different configuration settings. diff --git a/examples/gradle/dokka-customFormat-example/build.gradle.kts b/examples/gradle/dokka-customFormat-example/build.gradle.kts index 8d1d36ce..0c845572 100644 --- a/examples/gradle/dokka-customFormat-example/build.gradle.kts +++ b/examples/gradle/dokka-customFormat-example/build.gradle.kts @@ -1,4 +1,6 @@ import org.jetbrains.dokka.gradle.DokkaTask +import org.jetbrains.dokka.base.DokkaBase +import org.jetbrains.dokka.base.DokkaBaseConfiguration plugins { kotlin("jvm") version "1.7.20" @@ -15,16 +17,16 @@ repositories { mavenCentral() } -/** - * Custom format adds a custom logo - */ -tasks.register<DokkaTask>("dokkaCustomFormat") { - pluginConfiguration<org.jetbrains.dokka.base.DokkaBase, org.jetbrains.dokka.base.DokkaBaseConfiguration> { +tasks.dokkaHtml { + pluginConfiguration<DokkaBase, DokkaBaseConfiguration> { // Dokka's stylesheets and assets with conflicting names will be overriden. // In this particular case, logo-styles.css will be overriden and ktor-logo.png will // be added as an additional image asset customStyleSheets = listOf(file("logo-styles.css")) customAssets = listOf(file("ktor-logo.png")) + + // Text used in the footer + footerMessage = "(c) Custom Format Dokka example" } } diff --git a/examples/gradle/dokka-customFormat-example/demo.png b/examples/gradle/dokka-customFormat-example/demo.png Binary files differnew file mode 100644 index 00000000..8f9b88b0 --- /dev/null +++ b/examples/gradle/dokka-customFormat-example/demo.png |