Skip to content

Commit ebf18a8

Browse files
committed
feat: Add docs generation with Mkdocs and Dokka
1 parent 6bac4a8 commit ebf18a8

File tree

4 files changed

+49
-1
lines changed

4 files changed

+49
-1
lines changed

.github/workflows/docs.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Docs
2+
3+
on: [release]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
11+
- name: List directories
12+
run: ls -al
13+
14+
- name: Setup JDK 1.8
15+
uses: actions/setup-java@v1
16+
with:
17+
java-version: 1.8
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: '3.x'
23+
24+
- name: Setup Python dependencies
25+
run: pip3 install --upgrade pip && pip3 install -r ./docs/requirements.txt
26+
27+
- name: Generate Docs
28+
run: gradle dokkaGfm
29+
30+
- name: Cleanup existing docs
31+
run: rm -rf docs/docs/docs/api && mkdir docs/docs/api
32+
33+
- name: Copy generated docs
34+
run: cp -r build/dokka/coroutines-network-response-adapter/* docs/docs/docs/api
35+
36+
- name: Build mkdocs website
37+
run: cd ./docs/docs && mkdocs build

build.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id("org.jetbrains.kotlin.jvm").version("1.4.10")
3+
id("org.jetbrains.dokka") version "1.4.10"
34
maven
45
}
56

@@ -34,3 +35,7 @@ dependencies {
3435
testImplementation("com.squareup.moshi:moshi-kotlin:1.9.2")
3536
testImplementation("com.squareup.retrofit2:converter-moshi:$retrofitVersion")
3637
}
38+
39+
tasks.dokkaGfm.configure {
40+
outputDirectory.set(buildDir.resolve("dokka"))
41+
}

docs/docs/docs/api/index.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

settings.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,10 @@
88
*/
99

1010
rootProject.name = "coroutines-network-response-adapter"
11+
12+
pluginManagement {
13+
repositories {
14+
gradlePluginPortal()
15+
jcenter()
16+
}
17+
}

0 commit comments

Comments
 (0)