19 lines
450 B
TypeScript
19 lines
450 B
TypeScript
|
import { defineCodeRunnersSetup } from '@slidev/types'
|
||
|
|
||
|
export default defineCodeRunnersSetup(() => {
|
||
|
return {
|
||
|
async python(code, ctx) {
|
||
|
// Somehow execute the code and return the result
|
||
|
const result = await executePythonCodeRemotely(code)
|
||
|
return {
|
||
|
text: result
|
||
|
}
|
||
|
},
|
||
|
html(code, ctx) {
|
||
|
return {
|
||
|
html: sanitizeHtml(code)
|
||
|
}
|
||
|
},
|
||
|
// or other languages, key is the language id
|
||
|
}
|
||
|
})
|