From a1e6c901e5664c1a3b3ce48f644e581e78f887f9 Mon Sep 17 00:00:00 2001 From: ache Date: Mon, 30 Apr 2018 14:52:55 +0200 Subject: Add information to install and use --- README.md | 41 ++++++++++++++++++++++++++++++++++++++++- package.json | 2 +- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 97bad79..60c80ae 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/package.json b/package.json index bd021b6..1ab002f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "remark-line-input", - "version": "0.1.0", + "version": "0.3.1", "description": "A remark plugin to parse line input syntax", "main": "app.js", "scripts": { -- cgit v1.2.3