Skip to content

Commit afd66e0

Browse files
committed
Add module documentation and enhance Dokka configuration
- Add workflow to build and publish API documentation with Dokka - Introduce `.github/workflows/apidocs.yaml` to build and deploy API docs on `main` and release events. - Configure Gradle for Dokka builds and update project dependencies. - Include `:docs` module in project settings. - Introduce `Module.md` for `kotlin-sdk-server`, `kotlin-sdk-client`, and `kotlin-sdk-core` modules. - Update `.gitignore` to include `.idea/icon.png` and add placeholder icon files - Remove outdated documentation HTML files
1 parent a9e2797 commit afd66e0

File tree

712 files changed

+151
-76246
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

712 files changed

+151
-76246
lines changed

.github/workflows/apidocs.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build and Publish API Docs to GitHub Pages
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
push:
8+
branches: [ "main" ]
9+
# Allow running this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
jobs:
13+
deploy:
14+
15+
permissions:
16+
pages: write # to deploy to Pages
17+
id-token: write # to verify the deployment originates from an appropriate source
18+
19+
environment:
20+
name: github-pages
21+
url: ${{ steps.deployment.outputs.page_url }}
22+
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v5
26+
with:
27+
submodules: true # Fetch Hugo themes (true OR recursive)
28+
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
29+
30+
- name: Set up JDK 21
31+
uses: actions/setup-java@v5
32+
with:
33+
java-version: '21'
34+
distribution: 'temurin'
35+
cache: gradle
36+
37+
- name: Setup Gradle
38+
uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4.4.3
39+
40+
- name: Generate Dokka Site
41+
run: |-
42+
./gradlew :docs:clean :docs:dokkaGenerate
43+
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v4
46+
with:
47+
path: docs/build/dokka/html
48+
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ build/
1111
.idea/compiler.xml
1212
.idea/libraries/
1313
.idea
14+
!.idea/icon.png
1415
*.iws
1516
*.iml
1617
*.ipr

.idea/icon.png

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

buildSrc/src/main/kotlin/mcp.dokka.gradle.kts

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,55 @@ plugins {
55
}
66

77
dokka {
8-
moduleName.set("MCP Kotlin SDK - ${project.name}")
98

109
dokkaSourceSets.configureEach {
10+
includes.from("Module.md")
11+
12+
pluginsConfiguration.html {
13+
footerMessage = "Copyright © 2025 JetBrains s.r.o."
14+
customAssets + file("icon.png")
15+
}
16+
1117
sourceLink {
1218
localDirectory = projectDir.resolve("src")
1319
remoteUrl("https://github.com/modelcontextprotocol/kotlin-sdk/tree/main/${project.name}/src")
1420
remoteLineSuffix = "#L"
1521
}
1622

1723
documentedVisibilities(VisibilityModifier.Public)
18-
}
1924

20-
dokkaPublications.html {
21-
outputDirectory = rootProject.layout.projectDirectory.dir("docs/${project.name}")
25+
externalDocumentationLinks.register("ktor-client") {
26+
url("https://api.ktor.io/ktor-client/")
27+
packageListUrl("https://api.ktor.io/package-list")
28+
}
29+
30+
externalDocumentationLinks.register("kotlinx-coroutines") {
31+
url("https://kotlinlang.org/api/kotlinx.coroutines/")
32+
packageListUrl("https://kotlinlang.org/api/kotlinx.coroutines/package-list")
33+
}
34+
35+
externalDocumentationLinks.register("kotlinx-serialization") {
36+
url("https://kotlinlang.org/api/kotlinx.serialization/")
37+
packageListUrl("https://kotlinlang.org/api/kotlinx.serialization/package-list")
38+
}
2239
}
23-
}
40+
}
41+
//
42+
// tasks.withType<DokkaTask>().configureEach {
43+
// val dokkaBaseConfiguration = """
44+
// {
45+
// "customAssets": ["${file("assets/my-image.png")}"],
46+
// "customStyleSheets": ["${file("assets/my-styles.css")}"],
47+
// "footerMessage": "(c) $Insta MyOrg",
48+
// "separateInheritedMembers": false,
49+
// "templatesDir": "${file("dokka/templates")}",
50+
// "mergeImplicitExpectActualDeclarations": false
51+
// }
52+
// """
53+
// pluginsMapConfiguration.set(
54+
// mapOf(
55+
// // fully qualified plugin name to json configuration
56+
// "org.jetbrains.dokka.base.DokkaBase" to dokkaBaseConfiguration,
57+
// ),
58+
// )
59+
// }

docs/-m-c-p -kotlin -s-d-k/io.modelcontextprotocol.kotlin.sdk.client/-client-options/-client-options.html

Lines changed: 0 additions & 87 deletions
This file was deleted.

docs/-m-c-p -kotlin -s-d-k/io.modelcontextprotocol.kotlin.sdk.client/-client-options/capabilities.html

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)