uniorg plugin to add `id` attributes to headlines
npm install uniorg-sluguniorg-sluguniorg plugin to add anchors headings using GitHub's algorithm. Similar to rehype-slug but respects org-mode's CUSTOM_ID (as org-html-export).
``sh`
npm install uniorg-slug
`js
import { unified } from 'unified';
import uniorgParse from 'uniorg-parse';
import { uniorgSlug } from 'uniorg-slug';
import uniorg2rehype from 'uniorg-rehype';
import html from 'rehype-stringify';
const node = unified()
.use(uniorgParse)
.use(uniorgSlug)
.use(uniorg2rehype)
.use(html)
.processSync(
* headline
** nested headline
:PROPERTIES:
:CUSTOM_ID: blah
:END:
** headline
:PROPERTIES:
:ID: my-id
:END:
~id~ property is ignored.);
console.log(node.toString());
`
will output:
```
headline
nested headline
headline
id property is ignored.