-
Notifications
You must be signed in to change notification settings - Fork 466
Extract Kotlin Playground runnable samples into a separate plugin #4329
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
base: master
Are you sure you want to change the base?
Extract Kotlin Playground runnable samples into a separate plugin #4329
Conversation
…lesConfigurationTest
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.
Pull Request Overview
This PR introduces a new Dokka plugin called plugin-runnable-samples that makes @sample code blocks interactive and runnable using Kotlin Playground. The plugin extracts runnable samples functionality from the base plugin into a standalone, optional plugin.
Key changes:
- Creates new
plugin-runnable-samplesmodule with transformer, installer, and configuration components - Removes Kotlin Playground integration from the base plugin (DefaultSamplesTransformer, styles, scripts)
- Updates base plugin to use callback pattern for dark mode changes instead of directly managing Kotlin Playground
- Updates integration test expectations to reflect removed Kotlin Playground script references
Reviewed Changes
Copilot reviewed 156 out of 207 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| settings.gradle.kts | Adds new plugin-runnable-samples module to build |
| plugin-runnable-samples/* | New plugin with transformer, installer, configuration, tests, and resources |
| plugin-base/* | Removes runnable samples logic, styles, and scripts; refactors dark mode handling |
| dokka-subprojects/README.md | Documents new plugin in project structure |
| integration test files | Updates expected output to remove Kotlin Playground references |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private fun createSampleBody(imports: List<String>, body: String) = | ||
| // takeIf {} is needed so that joinToString's postfix is not added for empty lists, | ||
| // and trimMargin() then removes the first empty line | ||
| """ |${ |
Copilot
AI
Nov 3, 2025
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.
The comment on lines 101-102 is misaligned with the code. The opening triple-quote for the multi-line string starts on line 103, but the comment explaining trimMargin() appears on line 102, creating confusion about what the comment applies to. The comment should be moved above line 100 or reformatted to clearly explain the entire function's behavior.
|
(sorry, closed by accident)
|
…ndServer to KotlinPlaygroundServer




Impl #3041