viebel / klipse

Klipse is a JavaScript plugin for embedding interactive code snippets in tech blogs.
http://blog.klipse.tech/
GNU General Public License v3.0
3.1k stars 153 forks source link

Feature request: Javascript API #369

Open rdbeach opened 4 years ago

rdbeach commented 4 years ago

HI. I think the idea of being able to eval several languages right from the browser is a great idea. This is especially useful for teaching basic coding, coding interviews, etc. It would be nice, however, if this program was more controllable and customizable through javascript. A javascript API would broaden the scope of its application, to make it a more general purpose code evaluator.

For instance, the API would expose: Methods to get contents from user input. Methods to listen when a change has occurred in an input. Methods to evaluate content and return result. Methods to send result to appropriate output. Methods to control the behavior of klipsified elements.

Screen Shot 2020-06-03 at 2 23 35 PM

Also, it would be nice if we could keep the physical DOM separate from the evaluation of code, meaning that you would not have to klipsify any elements on the page in order to run these methods.

Finally, expose greater control over how an element is Klipsified. For instance, do you want an input box? Do you want an output box? Etc.

I understand that some of the above functions already exist. But even then, they are not well documented, and not very accessible to the und user.