Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
slorber opened this issue Aug 21, 2020 · 1 comment 路 Fixed by #4222
Closed

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

slorber opened this issue Aug 21, 2020 · 1 comment 路 Fixed by #4222
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.

Comments

@slorber
Copy link
Collaborator

slorber commented Aug 21, 2020

馃殌 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

@slorber slorber added feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. status: needs triage This issue has not been triaged by maintainers labels Aug 21, 2020
@slorber
Copy link
Collaborator Author

slorber commented Dec 10, 2020

@slorber slorber changed the title Ability to customize, or set heading anchor link ids Ability to set heading anchor link id (useful for i18n) Dec 10, 2020
@slorber slorber removed the status: needs triage This issue has not been triaged by maintainers label Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant