DEV Community

John Peters
John Peters

Posted on

CommonMark (Markdown)

StackOverFlow's new markdown editor looks great. Take a look.

Instead of direct HTML conversion they use AST conversion. This makes it immensely reusable in other languages. Java, C#, C++, Python, etc. They have also begun the process of standardization.

CommonMark

GitHub logo commonmark / commonmark.js

CommonMark parser and renderer in JavaScript

commonmark.js

Build Status NPM version

CommonMark is a rationalized version of Markdown syntax with a spec and BSD-licensed reference implementations in C and JavaScript.

For more information, see http://commonmark.org.

This repository contains the JavaScript reference implementation It provides a library with functions for parsing CommonMark documents to an abstract syntax tree (AST), manipulating the AST, and rendering the document to HTML or to an XML representation of the AST.

To play with this library without installing it, see the live dingus at http://try.commonmark.org/.

Installing

You can install the library using npm:

npm install commonmark

This package includes the commonmark library and a command-line executable, commonmark.

For client-side use, you can use one of the single-file distributions provided in the dist/ subdirectory of the node installation (node_modules/commonmark/dist/). Use either commonmark.js (readable source) or commonmark.min.js (minimized source).

Alternatively, bower install commonmark will install the needed distribution files in bower_components/commonmark/dist.

Top comments (0)