A utility plugin to use with rehype that adds class names to HAST (html tree)
npm install rehype-class-namesAdding classes to elements with rehype. Includes typescript support
```
npm install rehype-class-names
Add to rehype or unified pipeline with .use, where additions is an object
with keys that are the css selectors and the values are the classes you want to add.
For more information on what keys you can pass, see the hast-util-select documentation.
For more information on what values you can pass, see the hast-util-classnames documentation.
Example:
`js`
.use(addClasses, {
'h1,h2,h3': 'title',
h1: 'is-1',
h2: 'is-2',
h3: { 'hello': false, 32: true },
h4: 10,
h5: [],
p: 'one two',
a: "test",
ol: "list-decimal",
li: ['test', 'mega'],
})
This will output
`html``header
sub 2
sub 3
sub 4
Sub 5
Profile pictures are important.
Rider Jensen