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
447 stars 80 forks source link

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

Closed zoobestik closed 10 months ago

zoobestik commented 11 months 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',
});