Open f0x52 opened 5 years ago
Hm.. interesting. The compiler uses unified as a text parsing engine. You could checkout if there is a plugin that extracts this data. You could then attach it to the Edge as a “sections” array.
Maybe a combination of those plugins would do the trick.
https://www.npmjs.com/package/rehype-autolink-headings https://www.npmjs.com/package/rehype-slug https://www.npmjs.com/package/remark-outer-tochttps://www.npmjs.com/package/remark-outer-toc
Hey, for my site I'd like to be able to dynamically generate a list of the current page's sections. Something like Wikipedia's Content block at the start of a page. For this I need to access an array of all header markdown objects from handlebars, and they all need to get an id to use in the anchor tag.
Im not sure what the best place would be to hack this in, any ideas?