@z1c1/remark-directive-custom-dataset-tag-plugin
v0.1.1
Published
A remark plugin which helps create a custom html tag with specified dataset. This works together with `remark-directive`.
Downloads
5
Readme
@z1c1/remark-directive-custom-dataset-tag-plugin
A remark plugin which helps create a custom html tag with specified dataset. This works together with remark-directive
.
Usage
npm install --save @z1c1/remark-directive-custom-dataset-tag-plugin
import { unified } from 'unified';
import remarkParse from 'remark-parse';
import remarkDirective from 'remark-directive';
import remarkGfm from 'remark-gfm';
import remarkRehype from 'remark-rehype';
import rehypeStringify from 'rehype-stringify';
import remarkDirectiveCustomDatasetTagPlugin from '@z1c1/remark-directive-custom-dataset-tag-plugin';
// markdown text to html parser
const parseMarkdown = raw =>
unified()
.use(remarkParse)
.use(remarkDirective)
.use(remarkDirectiveCustomDatasetTagPlugin, { name: 'CUSTOM_NAME', class: 'custom-tag' })
.use(remarkGfm)
.use(remarkRehype, { allowDangerousHtml: true })
.use(rehypeStringify, { allowDangerousHtml: true })
.processSync(raw)
.toString();
Start
# eg. preparations
npm install
# eg. build the project
npm run build
# eg. test
npm test
# eg. release
npm run release
Contributing
Recently changes
See the change log.