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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a shorthand for making alternative named anchors #4023

Closed
flying-sausages opened this issue Jan 9, 2021 · 1 comment
Closed

Add a shorthand for making alternative named anchors #4023

flying-sausages opened this issue Jan 9, 2021 · 1 comment
Labels
closed: duplicate This issue or pull request already exists in another issue or pull request feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.

Comments

@flying-sausages
Copy link

🚀 Feature

Some nice shorthand for easily defining alternate anchor names for otherwise long headings

Have you read the Contributing Guidelines on issues?

Yup

Motivation

I like to use quite verbose headings, and I'd like to make shorter anchors so I can link to them easier. Each word in the heading makes the URI for it longer, and sometimes it's nice to use "codewords" for them.

Pitch

The other alternative is adding a line like this just above the heading

<a class="anchor enhancedAnchor_node_modules-@docusaurus-theme-classic-lib-theme-Heading-" tabindex="-1" name="logs"></a>

## Retrieving logs from the toolset

It would be nice to have some sort of mechanism to add these dynamically into the generated DOM instead of having to paste this quite long line in there.

For example adding it to the heading line such as this and ensre the same CSS is applied to it so that there isn't extra space added above or below the heading, and so that the heading does not get hidden behind the site header when the anchor link is clicked.

## Retrieving logs from the toolset <a name="logs"></a>

An alternative could be adding some <anchor> object which would get styled the same way the headings do, and would not conflict with the rendering. I would not know how to make a module like that in a way which it wold not interfere with the spacing above/below the headings, and end up inside the <h2> tag for example

@flying-sausages flying-sausages 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 Jan 9, 2021
@slorber
Copy link
Collaborator

slorber commented Jan 11, 2021

Hi,

There's already an issue for this: #3322

It's needed for i18n support, as we don't want anchor links to break when headings get translated.

@slorber slorber closed this as completed Jan 11, 2021
@Josh-Cena Josh-Cena added closed: duplicate This issue or pull request already exists in another issue or pull request and removed status: needs triage This issue has not been triaged by maintainers labels Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: duplicate This issue or pull request already exists in another issue or pull request feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Projects
None yet
Development

No branches or pull requests

3 participants