remark-select

1.0.0 • Public • Published

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 :

Screenshot

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

Readme

Keywords

Package Sidebar

Install

npm i remark-select

Weekly Downloads

3

Version

1.0.0

License

GPL-3.0-or-later

Unpacked Size

26.2 kB

Total Files

12

Last publish

Collaborators

  • ache