diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 30 |
1 files changed, 19 insertions, 11 deletions
@@ -2,36 +2,44 @@ CommonMark ========== CommonMark is a [specification of Markdown syntax][the spec], -together with BSD3-licensed implementations (`stmd`) in C and javascript. +together with BSD3-licensed implementations in C and JavaScript. The implementations ------------------- The C implementation provides both a library and a standalone program -`stmd` that converts Markdown to HTML. It is written in standard C99 +`cmark` that converts Markdown to HTML. It is written in standard C99 and has no library dependencies. (However, if you check it out from the repository, you'll need [`re2c`](http://re2c.org) to generate `scanners.c` from `scanners.re`. This is only a build dependency for developers, since `scanners.c` can be provided in a released source tarball.) - Usage: stmd [FILE*] + Usage: cmark [FILE*] Options: --help, -h Print usage information --ast Print AST instead of HTML --version Print version -The javascript implementation is a single javascript file, with -no dependencies, that can be linked to in an HTML page. A standalone -version (using `node.js`) is also provided (`js/markdown`), and there is -a "dingus" for playing with it interactively. (`make dingus` will start -this.) +The JavaScript implementation is a single JavaScript file, with +no dependencies, that can be linked to in an HTML page. (To build, +it, do `make js/commonmark.js`---this requires `browserify`, which you +can get using `npm install -g browserify`.) A command-line +version (using `node.js`) is also provided (`js/bin/markdown`), and +there is a "dingus" for playing with it interactively. (`make dingus` +will start this.) [Try it now!](http://jgm.github.io/stmd/js/) -[The spec] contains over 400 embedded examples which serve as conformance -tests. To run the tests for `stmd`, do `make test`. To run them for +Note that neither implementation attempts to sanitize link attributes or +raw HTML. If you use these libraries in applications that accept +untrusted user input, you must run the output through an HTML +sanitizer to protect against +[XSS attacks](http://en.wikipedia.org/wiki/Cross-site_scripting). + +[The spec] contains over 450 embedded examples which serve as conformance +tests. To run the tests for `cmark`, do `make test`. To run them for another Markdown program, say `myprog`, do `make test PROG=myprog`. To -run the tests for `stmd.js`, do `make testjs`. +run the tests for `commonmark.js`, do `make testjs`. [The spec]: http://jgm.github.io/stmd/spec.html |