Skip to content

Ability to set heading anchor link id (useful for i18n) #3322

@slorber

Description

@slorber

🚀 Feature

There are 2 usecases for letting user choose its own anchor ids instead of generating them from text.

The i18n process. If a translator translate the heading of a doc, the auto generated ids will change, which means that incoming anchor links from all the other places will break, and this can be annoying. See also the section on i18n RFC: #3317

Related links:
reactjs/react.dev#1605 (comment)
reactjs/react.dev#1605 (comment)
ethereum/ethereum-org-website#272
https://github.com/reactjs/reactjs.org/pull/1636/files
mdx-js/mdx#810

Unfortunately there's no special syntax in MD/MDX that allows to pass additional metadata to headings that we could use to generate anchor links

We should probably create a remark plugin that enables us to set explicit ids to each heading, so that they become "stable".

Also related to the ability to detect broken anchor links: #3321

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions