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

update (right-hand side) TOC template to use custom anchors #16469

Open
thaJeztah opened this issue Jan 9, 2023 · 2 comments
Open

update (right-hand side) TOC template to use custom anchors #16469

thaJeztah opened this issue Jan 9, 2023 · 2 comments
Labels
kind/enhancement Improves the usability of docs kind/help-wanted Relates to issues/PRs the project wants help on lifecycle/frozen

Comments

@thaJeztah
Copy link
Member

thaJeztah commented Jan 9, 2023

We use a custom liquid template to generate the right-hand (in page) TOC. This code currently generates anchor-links based on the headings themselves. For the reference documentation, we started using custom anchors based on the flags that they relate to. For example;

### <a name="tag"></a> Tag an image (-t, --tag)

With those custom anchors, both the "generated" anchor (#-tag-an-image--t---tag) and the custom (#tag) anchors can be used. The custom anchors allow us to have a predictable anchor, even if the heading is rephrased.

We should update the liquid code to understand the custom anchors, so that the TOC uses them, and so that users can bookmark those links without risking them to change if the headings are changed.

❓ Why not us liquid annotations ({: id=custom-anchor } for these?

We need to use the (hacky) <a name=...></a> because those pages are generated from Markdown pages in upstream repositories. We want those pages to be browsable / readable on GitHub, which doesn't support the liquid annotations. The <a id=...> HTML tags work both on GitHub and in HTML generated by Jekyll (although Jekyll itself doesn't know about them).

@thaJeztah thaJeztah added kind/enhancement Improves the usability of docs kind/help-wanted Relates to issues/PRs the project wants help on labels Jan 9, 2023
@thaJeztah
Copy link
Member Author

/cc @crazy-max 😄

@docker-robot
Copy link

docker-robot bot commented Nov 23, 2023

There hasn't been any activity on this issue for a long time.
If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment.
If not, this issue will be closed in 14 days. This helps our maintainers focus on the active issues.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improves the usability of docs kind/help-wanted Relates to issues/PRs the project wants help on lifecycle/frozen
Projects
None yet
Development

No branches or pull requests

1 participant