Skip to content

Commit

Permalink
docs: update README and LICENSE
Browse files Browse the repository at this point in the history
  • Loading branch information
DongWoo Kim committed Mar 19, 2020
1 parent 7680642 commit 2bd6c97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion libs/toastmark/LICENSE
Expand Up @@ -77,7 +77,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

---

The test examples in src/commonmark/__test__/base-examples.json is
The test cases in src/commonmark/__test__/base-examples.json are
copied from commonmark spec.

Copyright (C) 2014-15 John MacFarlane
Expand Down
10 changes: 5 additions & 5 deletions libs/toastmark/README.md
Expand Up @@ -6,17 +6,17 @@ ToastMark is a markdown parser extended from commonmark.js, with more advanced f
## Differences from commonmark.js

### GitHub Flavored Markdown(GFM Support)
commonmark.js is the reference implementation of [CommonMark](https://spec.commonmark.org/0.29/) and it does not support [Github Flavored Markdown: GFM](https://github.github.com/gfm/), which is extended markdown syntax based on CommonMark. ToastMark has its own implementation for supporting GFM.
### GitHub Flavored Markdown(GFM) Support
commonmark.js is the reference implementation of [CommonMark](https://spec.commonmark.org/0.29/) and doesn't support [GFM](https://github.github.com/gfm/), which is extended markdown syntax based on CommonMark. ToastMark has its own implementation for supporting GFM.

### Source Position Information
Although commonmark.js provide source position information related with each node, those are limited to block-level elements. ToastMark extended this feature to provide source position information for inline-level elements also.
Although commonmark.js provides source position information related with each node in AST(Abstract Syntax Tree), those are limited to block-level elements. ToastMark extended this feature to provide source position information for inline-level elements also.

### Incremental Parsing
As ToastMark is developed for the purpose of improving markdown editing experience, this must be the key feature of ToastMark. Instead of parsing the entire document whenever a user makes a change to a document, ToastMark parses only changed part of the document and update the existing AST(Abstract Syntax Tree). It also returns information about removed and inserted nodes, which can be used to update syntax highlithing or preview contents incrementally.
As ToastMark is developed for the purpose of improving markdown editing experience, this must be the key feature of ToastMark. Instead of parsing the entire document whenever a user makes a change to a document, ToastMark parses only changed part of the document and update the existing AST. It also returns information about removed and inserted nodes, which can be used to update syntax highlithing or preview contents incrementally.

### Searching and Editing AST
ToastMark provides a bunch of useful methods to search the existing AST, such as `findNodeAtPosition` and `findNodeById`. These methods can be used for synchronizing scroll position of markdown editor and preview contents, updating the style of the toolbar buttons correspond to the cursor position, and so on. We are also planning to add more methods to edit existing AST to support commands like `Bold`, `Italic`, and `OrderedList` which can be triggered by toolbar buttons and keyboard shortcuts.
ToastMark provides useful methods to search the existing AST, such as `findNodeAtPosition` and `findNodeById`. These methods can be used for synchronizing scroll position of markdown editor and preview contents, updating the style of the toolbar buttons correspond to the cursor position, and so on. We are also planning to add more methods to edit existing AST to support commands like `Bold`, `Italic`, and `OrderedList` which can be triggered by toolbar buttons and keyboard shortcuts.

### TypeScript
The entire codebase is converted from JavaScript to TypeScript.

0 comments on commit 2bd6c97

Please sign in to comment.