aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorporokoro <porokorodev@gmail.com>2016-03-20 03:51:42 +0100
committerporokoro <porokorodev@gmail.com>2016-03-20 03:51:42 +0100
commit9e805338084e123706052b8328b2c92b4fd3a917 (patch)
tree42e41e117dc72f9c30353ab031f6677842d41981 /README.md
parent6b551610dfe0503a312b14fd860b2758d7707b1c (diff)
downloaddokka-9e805338084e123706052b8328b2c92b4fd3a917.tar.gz
dokka-9e805338084e123706052b8328b2c92b4fd3a917.tar.bz2
dokka-9e805338084e123706052b8328b2c92b4fd3a917.zip
Update README, explaining how to use Dokka with Android and how to set custom source directories
Diffstat (limited to 'README.md')
-rw-r--r--README.md36
1 files changed, 29 insertions, 7 deletions
diff --git a/README.md b/README.md
index c45b2acc..88f4f632 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-dokka [![TeamCity (build status)](https://img.shields.io/teamcity/http/teamcity.jetbrains.com/s/Kotlin_Dokka_DokkaAntMavenGradle.svg)](https://teamcity.jetbrains.com/viewType.html?buildTypeId=Kotlin_Dokka_DokkaAntMavenGradle&branch_KotlinTools_Dokka=%3Cdefault%3E&tab=buildTypeStatusDiv) [ ![Download](https://api.bintray.com/packages/kotlin/dokka/dokka/images/download.svg) ](https://bintray.com/kotlin/dokka/dokka/_latestVersion)
+dokka [![TeamCity (build status)](https://img.shields.io/teamcity/http/teamcity.jetbrains.com/s/Kotlin_Dokka_DokkaAntMavenGradle.svg)](https://teamcity.jetbrains.com/viewType.html?buildTypeId=Kotlin_Dokka_DokkaAntMavenGradle&branch_KotlinTools_Dokka=%3Cdefault%3E&tab=buildTypeStatusDiv) [ ![Download](https://api.bintray.com/packages/kotlin/dokka/dokka/images/download.svg) ](https://bintray.com/kotlin/dokka/dokka/_latestVersion)
=====
Dokka is a documentation engine for Kotlin, performing the same function as javadoc for Java.
@@ -121,9 +121,9 @@ Please see the [Dokka Maven example project](https://github.com/JetBrains/kotlin
```groovy
buildscript {
repositories {
- mavenLocal()
jcenter()
}
+
dependencies {
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}"
}
@@ -148,6 +148,7 @@ dokka {
url = "https://github.com/cy6erGn0m/vertx3-lang-kotlin/blob/master/src/main/kotlin"
suffix = "#L"
}
+ sourceDirs = files('src/main/kotlin')
}
```
@@ -169,6 +170,27 @@ task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
Please see the [Dokka Gradle example project](https://github.com/JetBrains/kotlin-examples/tree/master/gradle/dokka-gradle-example) for an example.
+#### Android
+
+If you are using Android there is a separate gradle plugin. Just make sure you apply the plugin after
+`com.android.library` and `kotlin-android`.
+
+```groovy
+buildscript {
+ repositories {
+ jcenter()
+ }
+
+ dependencies {
+ classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:${dokka_version}"
+ }
+}
+
+apply plugin: 'com.android.library'
+apply plugin: 'kotlin-android'
+apply plugin: 'org.jetbrains.dokka-android'
+```
+
## Dokka Internals
### Documentation Model
@@ -184,26 +206,26 @@ Each reference between nodes also has semantic attached, and there are three of
2. Detail - reference means that target describes source in more details, form tree.
3. Link - any link to any other node, free form.
-Member & Detail has reverse Owner reference, while Link's back reference is also Link.
+Member & Detail has reverse Owner reference, while Link's back reference is also Link.
-Nodes that are Details of other nodes cannot have Members.
+Nodes that are Details of other nodes cannot have Members.
### Rendering Docs
When we have documentation model, we can render docs in various formats, languages and layouts. We have some core services:
* FormatService -- represents output format
-* LocationService -- represents folder and file layout
+* LocationService -- represents folder and file layout
* SignatureGenerator -- represents target language by generating class/function/package signatures from model
Basically, given the `documentation` as a model, we do this:
```kotlin
- val signatureGenerator = KotlinSignatureGenerator()
+ val signatureGenerator = KotlinSignatureGenerator()
val locationService = FoldersLocationService(arguments.outputDir)
val markdown = JekyllFormatService(locationService, signatureGenerator)
val generator = FileGenerator(signatureGenerator, locationService, markdown)
- generator.generate(documentation)
+ generator.generate(documentation)
```
## Building Dokka