remark-code-dataset
v2.1.0
Published
adds codeblock meta as html dataset
Downloads
1
Readme
remark-code-dataset
What
It's a remark plugin which adds all metadata passed to a code block as data attributes for exploitation in rehype or client-side.
Demo
export default function App() {
return <div>hello world</div>;
}
↓
<code class="language-jsx" data-group="demo" data-file="index.jsx">
<!-- some html -->
</code>
How
- Install the plugin with
npm i remark-code-dataset
- Import the plugin with `import remarkCodeDataset from 'remark-code-dataset'
- Add to your remark plugin stack
[remarkCodeDataset]