remark-select
v1.0.0
Published
A remark plugin to parse select box syntax.
Downloads
5
Readme
remark-select
A remark plugin that parse Mardown syntax to add support for select element.
Syntax
You can add a select element this way :
Who is the stronger ? : [ Samus | Peach | Zelda |v]
Wich leads to :
Installation
Easy as npm i
$ npm install remark-line-input
You install also that plugins : "unified remark-parse rehype-stringify remark-rehype"
$ npm install unified remark-parse rehype-stringify remark-rehype
Usage
An example of code :
const unified = require('unified')
const remarkParse = require('remark-parse')
const stringify = require('rehype-stringify')
const remark2rehype = require('remark-rehype')
const select = require('remark-select')
const testFile = `Choose a player : [ Luigi | Mario | Peach | Falco | Zelda |v]{.mario .link .starFox}
Choose an action : [ Start | Restart | Quit |v]`
unified()
.use(remarkParse)
.use(select)
.use(remark2rehype)
.use(stringify)
.process( testFile, (err, file) => {
console.log(String(file));
} );
Configuration
This plugin support custom HTML attributes :
[ Mario | Peach | Luigi |v]{.nintendo #select-character}
Licence
MIT