Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/twangodev/mkdocs-kotlin-playground
Provides support for using the Kotlin Playground with mkdocs-material
https://github.com/twangodev/mkdocs-kotlin-playground
kotlin kotlin-playground mkdocs mkdocs-material
Last synced: about 1 month ago
JSON representation
Provides support for using the Kotlin Playground with mkdocs-material
- Host: GitHub
- URL: https://github.com/twangodev/mkdocs-kotlin-playground
- Owner: twangodev
- License: mit
- Created: 2023-08-29T20:26:48.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-29T21:08:10.000Z (over 1 year ago)
- Last Synced: 2024-11-02T11:25:27.542Z (3 months ago)
- Topics: kotlin, kotlin-playground, mkdocs, mkdocs-material
- Language: CSS
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mkdocs-kotlin-playground
Replaces fenced kotlin code blocks with an themed and interactive Kotlin Playground.## Usage
First, copy `kotlin.js` and `kotlin.css` into the respective `javascripts` and `stylesheets` directories in your mkdocs project.> Note: The `javascripts` and `stylesheets` directories should be in your `./docs/` directory.
Next add the following to your `mkdocs.yml`:
```yaml
extra_javascript:
- javascripts/kotlin.js
- https://unpkg.com/kotlin-playground@1
extra_css:
- stylesheets/kotlin.css
```This plugin activates the Kotlin Playground for all fenced code blocks with the language `kotlin`.
## Extra Features
### Kotlin Playground Options
#### `//sampleStart` and `//sampleEnd`
You can use `//sampleStart` and `//sampleEnd` to specify a range of lines to be shown in the Kotlin Playground. This is useful if you want to show a small snippet of code in the documentation, but want to allow users to edit the entire file.For example, to show the contents of the `main` function in the Kotlin Playground:
```kotlin
fun myHiddenFunction() {
println("mystery")
}fun main() {
//sampleStart
println("Hello World!")
myHiddenFunction()
//sampleEnd
}
```