I’m writing a blog post in mdsvex and my article contains JavaScript code blocks. I’d like to be able to use the code within the JavaScript block to provide an interactive illustration of the code. Currently, I have to duplicate the code the script tag to make it interactive which is not ideal.
Here’s an example:
function privateFunction() {
console.log("This is a private function")
}
In this example, I’d like the privateFunction to be callable from the button’s click event without having to also define it in a script tag. This feature would make writing interactive blog posts much easier. Thank you for considering this request!
I’m writing a blog post in mdsvex and my article contains JavaScript code blocks. I’d like to be able to use the code within the JavaScript block to provide an interactive illustration of the code. Currently, I have to duplicate the code the script tag to make it interactive which is not ideal.
Here’s an example:
In this example, I’d like the
privateFunction
to be callable from the button’s click event without having to also define it in a script tag. This feature would make writing interactive blog posts much easier. Thank you for considering this request!