{"repo":"IGassmann/remark-directive-rehype","free":true,"listed":false,"github":"https://github.com/IGassmann/remark-directive-rehype","clone":"git clone https://github.com/IGassmann/remark-directive-rehype.git","description":"Remark plugin to enable Markdown directives to be parsed as HTML.","language":"TypeScript","stars":38,"topics":["plugin","remark","markdown","remark-plugin","directive","rehype","remark-directive","hast","mdast","unified"],"license":"Unlicense","category":"productivity","readme_excerpt":"remark-directive-rehype [remark][] plugin to integrate [remark-directive][] with [remark-rehype][]. What is this? This package is a [unified][] ([remark][]) plugin to enable Markdown directives to be parsed as HTML when using [remark-rehype][]. Markdown directives are first parsed with [remark-directive][] which needs to be used before this plugin. unified is a project that transforms content with abstract syntax trees (ASTs). remark adds support for markdown to unified. rehype adds support for HTML to unified. mdast is the markdown AST that remark uses. hast is the HTML AST that rehype uses. This is a remark plugin that transforms mdast. When should I use this? This project is useful when you want directives parsed by [remark-directive][] to be later parsed as HTML ([hast][] nodes) when using [remark-rehype][]. This is specifically useful when one wants to convert Markdown directives into HTML tags that can be outputted as components with [react-markdown][]. Installation This package is ESM only. In Node.js (version 20+), install with [npm][]: Usage Say we have the following file, example.md : And our module example.js looks as follows: Now running node example yields: Examples Example: react-markdown You can use it with [react-markdown][] to render custom React components for each defined directive. Yields: Example: rehype-components You can use in conjunction with [rehype-components][] to render components made with [hastscript][]. See [rehype-components][] for more inform","default_branch":null,"files":null,"tree":[],"storefront":"/r/IGassmann","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/IGassmann/remark-directive-rehype/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}