summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md32
-rw-r--r--js/README.md16
2 files changed, 21 insertions, 27 deletions
diff --git a/README.md b/README.md
index 20f6411..4bbac88 100644
--- a/README.md
+++ b/README.md
@@ -18,15 +18,10 @@ very fast (see [benchmarks](benchmarks.md)).
It is easy to use `libcmark` in python, lua, ruby, and other dynamic
languages: see the `wrappers/` subdirectory for some simple examples.
-The JavaScript implementation is a single JavaScript file, with
-no dependencies, that can be linked into an HTML page.
-
-``` javascript
-var reader = new commonmark.DocParser();
-var writer = new commonmark.HtmlRenderer();
-var parsed = reader.parse("Hello *world*");
-var result = writer.render(parsed);
-```
+The JavaScript implementation provides both an NPM package and a
+single JavaScript file, with no dependencies, that can be linked into
+an HTML page. For further information, see the
+[README in the js directory](js/README.md).
**A note on security:**
Neither implementation attempts to sanitize link attributes or
@@ -118,23 +113,8 @@ If you want to use it in a client application, you can fetch
a pre-built copy of `commonmark.js` from
<http://spec.commonmark.org/js/commonmark.js>.
-Or, to build it (this requires `browserify`):
-
- make js/commonmark.js
-
-To run tests for the JavaScript library:
-
- make testjs
-
-To run benchmarks against some other JavaScript converters:
-
- npm install showdown marked markdown-it
- make benchjs
-
-To start an interactive dingus that you can use to try out
-the library:
-
- make dingus
+For further information, see the
+[README in the js directory](js/README.md).
The spec
--------
diff --git a/js/README.md b/js/README.md
index 6803754..0d5cf13 100644
--- a/js/README.md
+++ b/js/README.md
@@ -27,6 +27,20 @@ a standalone JavaScript file `js/commonmark.js`,
suitable for linking into a web page, or just fetch
<http://spec.commonmark.org/js/commonmark.js>.
+To run tests for the JavaScript library:
+
+ make testjs
+
+To run benchmarks against some other JavaScript converters:
+
+ npm install showdown marked markdown-it
+ make benchjs
+
+To start an interactive dingus that you can use to try out
+the library:
+
+ make dingus
+
Usage
-----
@@ -34,7 +48,7 @@ Instead of converting Markdown directly to HTML, as most converters
do, `commonmark.js` parses Markdown to an AST (abstract syntax tree),
and then renders this AST as HTML. This opens up the possibility of
manipulating the AST between parsing and rendering. For example, one
-could transform all emphasis into ALL CAPS.
+could transform emphasis into ALL CAPS.
Here's a basic usage example: