JetBrains / kotlin-playground

Self-contained component to embed in websites for running Kotlin code
https://jetbrains.github.io/kotlin-playground/examples/
Apache License 2.0
455 stars 83 forks source link

feat; KTL-1138: add method to generate a link to the playground #192

Closed zoobestik closed 1 year ago

zoobestik commented 1 year ago
import { generateCrosslink } from 'kotlin-playground/dist/crosslink';

const link1 = generateCrosslink('println("Hello!")');
// or
const link2 = generateCrosslink('println("Hello!")', {
    targetPlatform: 'JAVA',
    compilerVersion: '1.5.21',
});