Hacker News new | past | comments | ask | show | jobs | submit login

Just wanted to take this opportunity to say thanks again for CodeMirror, and it's great to see the progress you've been making with ProseMirror.

We use CM at Overleaf[1], and it's been fantastic. To make it easier for non-LaTeX users to collaborate on LaTeX documents, we built our own rich text editor on top of it[2], which is still in beta. Still got a long way to go!

[1] https://www.overleaf.com

[2] https://www.overleaf.com/blog/81




So cool to see one of my favorite products on here. Overleaf's rich text view is a total revolution for LaTeX editing and I've always wondered how it combined MathJax with an editor. Love this product.


Thanks, glad you like it!

What was so cool recently was that a group of 7th/8th graders[1] used us to write their 300-page engineering notebook!! Just amazing :)

[1] https://www.overleaf.com/blog/289-the-nano-ninjas-building-r...


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.


As 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

[2] http://marijnhaverbeke.nl/blog/prosemirror.html

[3] https://codemirror.net/doc/realworld.html

[4] http://codemirror.net/demo/folding.html


How is CodeMirror different from ProseMirror?


The 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.


The first is for code and the latter is for prose (non-code writing such as this comment).


Okay, 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).


Code 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.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: