diff options
author | ache <ache@ache.one> | 2018-04-30 14:52:55 +0200 |
---|---|---|
committer | ache <ache@ache.one> | 2018-04-30 14:52:55 +0200 |
commit | a1e6c901e5664c1a3b3ce48f644e581e78f887f9 (patch) | |
tree | 6fe0f4c8b7b73a884073d3b27430749171237bdf /README.md | |
parent | Fix a typo in the test file (diff) |
Add information to install and use
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 41 |
1 files changed, 40 insertions, 1 deletions
@@ -15,10 +15,49 @@ Wich leads to : ![Screenshot](https://raw.githubusercontent.com/arobase-che/remark-line-input/master/images/example_1.png) +You must use at least 2 underscores, and no spaces are allowed between the opening bracket and the first underscore nor between the last underscore and the closing bracket. Spaces can be used in the placeholder : + +```markdown +[___hold my beer___] +``` ## Installation -Not ready at the moment. +Easy as npm i + +```shell +$ npm install remark-line-input +``` + +You install also that plugins : "unified remark-parse rehype-stringify remark-rehype" +```shell +$ npm install unified remark-parse rehype-stringify remark-rehype +``` + +## Usage + +An example of code : + +```js +const unified = require('unified') +const remarkParse = require('remark-parse') +const stringify = require('rehype-stringify') +const remark2rehype = require('remark-rehype') + +const lineInput = require('remark-line-input') + +const testFile = `Login : [__email or username__]{#login} +Passwd: [__Passwd__]{#password type=password}` + +unified() + .use(remarkParse) + .use(lineInput) + .use(remark2rehype) + .use(stringify) + .process( testFile, (err, file) => { + console.log(String(file)); + } ); +``` ## Configuration |