You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: OrchidCore/src/orchid/resources/pages/plugins/OrchidSyntaxHighlighter/index.md
+27-1
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,8 @@ tags:
12
12
## About
13
13
14
14
Add syntax highlighting to code snippets in your Orchid site. Supports pre-rendered highlighting with
15
-
[Pygments](http://pygments.org/), and browser-based highlighting with [PrismJS](https://prismjs.com/)
15
+
[Pygments](http://pygments.org/), browser-based highlighting with [PrismJS](https://prismjs.com/), and runnable Kotlin
16
+
code snippets with [Kotlin Playground](https://github.com/JetBrains/kotlin-playground).
16
17
17
18
## Demo
18
19
@@ -96,3 +97,28 @@ allPages:
96
97
- 'kotlin'
97
98
- 'yaml'
98
99
```
100
+
101
+
### Kotlin Playground
102
+
103
+
The Kotlin Playground allows you to convert Kotlin code snippets into playgrounds that are runnable right in your
104
+
browser. The `kotlinPlayground` component adds the script from their CDN, which will select all elements on the page
105
+
with your runnable Kotlin code and convert them into embedded runnable playgrounds. By default, all Markdown code
106
+
snippets with a language of `run-kotlin` are converted.
107
+
108
+
```yaml
109
+
allPages:
110
+
components:
111
+
- type: 'pageContent'
112
+
- type: 'kotlinPlayground'
113
+
selector: "pre code[class='language-run-kotlin']"
114
+
```
115
+
116
+
You can configure each individual playground using the attributes described in the [Kotlin playground docs](https://github.com/JetBrains/kotlin-playground#customizing-editors).
117
+
These can be added from Markdown snippets with the following syntax:
Copy file name to clipboardexpand all lines: languageExtensions/OrchidSyntaxHighlighter/src/main/kotlin/com/eden/orchid/languages/highlighter/SyntaxHighlighterModule.kt
0 commit comments