From 201799e31c8ff74d0fb6afc433a3f0a80ac92f37 Mon Sep 17 00:00:00 2001 From: ache Date: Sun, 6 May 2018 20:03:23 +0200 Subject: Update README --- README.md | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index fc3f61a..43ad188 100644 --- a/README.md +++ b/README.md @@ -58,18 +58,37 @@ const unified = require('unified') const remarkParse = require('remark-parse') const stringify = require('rehype-stringify') const remark2rehype = require('remark-rehype') +const remarkAttr = require('remark-attr') -const remarkAttr = require('remark-attr'); ``` ### Usage: ```javascript +const testFile = ` + +Here a test : + +![ache avatar](https://ache.one/res/ache.svg){ height=100 } + +` + unified() .use(remarkParse) .use(remarkAttr) .use(remark2rehype) .use(stringify) + .process( testFile, (err, file) => { + console.log(String(file)) + } ) +``` + +Output : + +```shell +$ node index.js +

Here a test :

+

ache avatar

``` @@ -79,17 +98,9 @@ unified() -[build-badge]: https://img.shields.io/travis/zestedesavoir/zmarkdown.svg - -[build-status]: https://travis-ci.org/zestedesavoir/zmarkdown - -[coverage-badge]: https://img.shields.io/coveralls/zestedesavoir/zmarkdown.svg - -[coverage-status]: https://coveralls.io/github/zestedesavoir/zmarkdown - [zds]: https://zestedesavoir.com -[npm]: https://www.npmjs.com/package/remark-ping +[npm]: https://www.npmjs.com/package/remark-attr [mdast]: https://github.com/syntax-tree/mdast/blob/master/readme.md -- cgit v1.2.3