5 ms·
This is awesome, how did you implement the live code editor?
by icu 4y ago
This is awesome, how did you implement the live code editor?
- ianthehenry 4y agoIt's CodeMirror! All I had to do was write a Janet grammar for it -- very easy to do. CodeMirror is pretty amazing -- I was able to implement the "edit values with your mouse" by just asking CodeMirror for the syntax node under the cursor, checking if it parsed as a number, and if so replacing it with a different string. https://codemirror.net/ https://codemirror.net/ https://github.com/ianthehenry/codemirror-lang-janet https://github.com/ianthehenry/codemirror-lang-janet I went with CodeMirror after reading this post: https://blog.replit.com/codemirror https://blog.replit.com/codemirror and I've been super happy with it.