-
Notifications
You must be signed in to change notification settings - Fork 160
Add module documentation and enhance Dokka configuration #261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Build and Publish API Docs to GitHub Pages | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
# Allow running this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
|
||
permissions: | ||
pages: write # to deploy to Pages | ||
id-token: write # to verify the deployment originates from an appropriate source | ||
|
||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v5 | ||
with: | ||
submodules: true # Fetch Hugo themes (true OR recursive) | ||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | ||
|
||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v5 | ||
with: | ||
java-version: '21' | ||
distribution: 'temurin' | ||
cache: gradle | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v4 | ||
|
||
- name: Generate Dokka Site | ||
run: |- | ||
./gradlew :docs:clean :docs:dokkaGenerate | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v4 | ||
with: | ||
path: build/dokka/html | ||
|
||
- name: Deploy to GitHub Pages | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do I understand correctly that the deploy will be from github actions instead of main/docs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes. But I can test it only once workflow is merged to default branch |
||
id: deployment | ||
uses: actions/deploy-pages@v4 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ build/ | |
.idea/compiler.xml | ||
.idea/libraries/ | ||
.idea | ||
!.idea/icon.png | ||
*.iws | ||
*.iml | ||
*.ipr | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,19 +5,35 @@ plugins { | |
} | ||
|
||
dokka { | ||
moduleName.set("MCP Kotlin SDK - ${project.name}") | ||
|
||
dokkaSourceSets.configureEach { | ||
includes.from("Module.md") | ||
|
||
pluginsConfiguration.html { | ||
footerMessage = "Copyright © 2024-2025 Anthropic, PBC" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should change the copyright, for example like in C#? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a question, but not to me :) I took it from here for consistency. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea, I understand |
||
} | ||
|
||
sourceLink { | ||
localDirectory = projectDir.resolve("src") | ||
remoteUrl("https://github.com/modelcontextprotocol/kotlin-sdk/tree/main/${project.name}/src") | ||
remoteLineSuffix = "#L" | ||
} | ||
|
||
documentedVisibilities(VisibilityModifier.Public) | ||
} | ||
|
||
dokkaPublications.html { | ||
outputDirectory = rootProject.layout.projectDirectory.dir("docs/${project.name}") | ||
externalDocumentationLinks.register("ktor-client") { | ||
url("https://api.ktor.io/ktor-client/") | ||
packageListUrl("https://api.ktor.io/package-list") | ||
} | ||
|
||
externalDocumentationLinks.register("kotlinx-coroutines") { | ||
url("https://kotlinlang.org/api/kotlinx.coroutines/") | ||
packageListUrl("https://kotlinlang.org/api/kotlinx.coroutines/package-list") | ||
} | ||
|
||
externalDocumentationLinks.register("kotlinx-serialization") { | ||
url("https://kotlinlang.org/api/kotlinx.serialization/") | ||
packageListUrl("https://kotlinlang.org/api/kotlinx.serialization/package-list") | ||
} | ||
} | ||
} | ||
} |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docker image pinning is actually recommended for security reasons.
We can skip it today since the Renovate is not configured.
https://docs.renovatebot.com/docker/#digest-pinning
https://docs.renovatebot.com/modules/manager/github-actions/#digest-pinning-and-updating