How to add CodeMirror to an input

I am probably too stupid to find it, but is there a documentation that provides a simple setup by step instruction as of how to add CodeMirror 6 to an HTML Textarea?
I know how to do it, but I think this is something that is kind of the “first step” for everyone, and I am used to these libs (select2, BS, etc etc) having a “Start here” page where they provide CDN or download links, and a few instructions as of how to get started.

Again, probably I just have tomatoes on my eyes and cant find it :frowning:

This doesn’t really exist. Loading CodeMirror isn’t a matter of just dropping in a CDN script tag, since it uses a bunch of dependencies, and you’ll want to bundle it on your side. And ‘adding’ CodeMirror to a textarea isn’t really a thing – version 5 tried to pretend it was that easy with its fromTextArea function, but that was very leaky. So basically, there’s no 5-line copy-paste snippet that will get this library into your page, and the examples are the closest thing to what you’re asking.

1 Like