4 ms·
Oh yes, I want to say thank you too! I just discovered CodeMirror, and it's wonderful. It was easy to make it to do just what I wanted, and it feels so snappy (
by DonHopkins 11y ago
Oh yes, I want to say thank you too! I just discovered CodeMirror, and it's wonderful. It was easy to make it to do just what I wanted, and it feels so snappy (both fast, and easily plugged together with other code). I'll definitely check out ProseMirror too.
- amelius 11y agoHow is CodeMirror different from ProseMirror?
- nacs 11y agoThe first is for code and the latter is for prose (non-code writing such as this comment).
- amelius 11y agoOkay, that makes sense. But, then again, shouldn't a single editor be able to handle those two usage-domains? (As this would mean the editor would be more powerful in terms of extensibility).
- atombender 11y agoCode is line-oriented and usually monospaced. Prose is not, and usually requires local layout (spacing, alignment and so on), embedded media (such as images) and variable typography.
- cben 11y agoThe model CodeMirror edits is flat text. It can apply styles (including variable fonts) that are a pure function of the text, and there are APIs to imperatively apply extra styling and even insert "widgets" (arbitrary DOM elements) and hooks to react to events. This lets you (ab)use CodeMirror for semi-WYSIWYG editing reasonably easily, but it works best when you strive to keep the rendering a function of the underlying text. E.g. Firepad abuses CodeMirror for WYSIWYG, which generally functions well, but after a couple years they're still debugging some problems with copy-paste. And I think they only pulled it off by maintaining a well-defined WYSIWYG data model underneath CodeMirror (they needed it for syncing). ProseMirror's model is structured. It's a nesting of elements strictly conforming to a configurable schema (by default close in spirit to Markdown - paragraphs/lists, emphasis, links, etc). Note that it's not "flat WYSIWYG" where each character/line has a style; a sub-list is actually inside the parent list, not just a bullet which happens to have higher indentation.
- DonHopkins 11y agoAs nacs said but in other words, CodeMirror is syntax colored and directed code editing (emacs), while ProseMirror is wysiwyg text editing (word). CodeMirror was started in early 2007. [1] ProseMirror is newer, announced July 7 2015 [2]. You've probably been using CodeMirror but didn't even realize it -- it's ubiquitous! >CodeMirror is an open-source project shared under an MIT license. It is the editor used in the dev tools for both Firefox and Chrome, Light Table, Adobe Brackets, Bitbucket, and many other projects [3]. Check out the CodeMirror JavaScript, HTML and Markup code folding demo -- who could say no to that? [4] [1] https://en.wikipedia.org/wiki/CodeMirror https://en.wikipedia.org/wiki/CodeMirror [2] http://marijnhaverbeke.nl/blog/prosemirror.html http://marijnhaverbeke.nl/blog/prosemirror.html [3] https://codemirror.net/doc/realworld.html https://codemirror.net/doc/realworld.html [4] http://codemirror.net/demo/folding.html http://codemirror.net/demo/folding.html