1.0.0 • Published 5 years ago

remark-select v1.0.0

Weekly downloads
6
License
GPL-3.0-or-later
Repository
github
Last release
5 years ago

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

1.0.0

5 years ago

0.9.3

6 years ago

0.9.2

6 years ago

0.9.1

6 years ago

0.9.0

6 years ago

0.1.0

6 years ago