rescript-association / reasonml.org

Deprecated in favor of rescript-lang.org
MIT License
125 stars 34 forks source link

Enable custom ids in markdown headers #122

Open ryyppy opened 4 years ago

ryyppy commented 4 years ago

It would be useful for headers to be fixed on a specific anchor id, so it's easier for us to implement localization and similar features later on.

This is how reactjs.org does it: https://github.com/reactjs/de.reactjs.org/blob/master/plugins/gatsby-remark-header-custom-ids/index.js

Example:

## Some header {#some-header}

#some-header would now be the anchor id.

This is extremely useful if we decide on a localization process which requires our repo to be forked. E.g. the German version could then be like:

## Eine Überschrift {#some-header}

Without messing with the actual anchor id. The concrete implementation would probably inlining remark-slug, keeping the original implementation but als add the new behavior as defined in the reactjs.org plugin.