Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is awesome, how did you implement the live code editor?


It'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://github.com/ianthehenry/codemirror-lang-janet

I went with CodeMirror after reading this post: https://blog.replit.com/codemirror and I've been super happy with it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: