Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Links to sections in docs are ambiguous #1857

Closed
chrismwendt opened this issue Jan 13, 2019 · 3 comments · Fixed by sourcegraph/docsite#8
Closed

Links to sections in docs are ambiguous #1857

chrismwendt opened this issue Jan 13, 2019 · 3 comments · Fixed by sourcegraph/docsite#8
Assignees
Labels
bug An error, flaw or fault that produces an incorrect or unexpected result, or behavior. docs
Milestone

Comments

@chrismwendt
Copy link
Contributor

URL links to sections are unable to disambiguate between multiple sections with the same name (e.g. authorization-object under either GitHub or GitLab)

https://docs.sourcegraph.com/admin/site_config/all#authorization-object

@chrismwendt chrismwendt added this to the Backlog milestone Jan 13, 2019
@sqs sqs added the docs-ux User experience of our docs (not doc content-related) label Jan 30, 2019
@sqs sqs modified the milestones: Backlog, 3.1 Jan 30, 2019
@sqs sqs self-assigned this Jan 30, 2019
@sqs sqs removed the docs-ux User experience of our docs (not doc content-related) label Jan 30, 2019
@sqs
Copy link
Member

sqs commented Jan 30, 2019

I will fix this in docsite so that anchors are disambiguated. If there are multiple headers that all have the raw text foo, then the anchors will be foo, foo-1, foo-2, etc. (or maybe I will use the parent header to try to disambiguate, too).

@sqs
Copy link
Member

sqs commented Jan 30, 2019

So the <h1 id="..."> attributes are being disambiguated correctly, but the in-page links are incorrect (including the auto-generated # links to the left side of headers). The fix is slightly simpler than I expected.

This is similar to shurcooL/github_flavored_markdown#18.

@sqs sqs modified the milestones: 3.1, 3.0 Jan 30, 2019
@sqs sqs added the bug An error, flaw or fault that produces an incorrect or unexpected result, or behavior. label Jan 30, 2019
sqs referenced this issue in sourcegraph/docsite Jan 30, 2019
The previous fix for sourcegraph/sourcegraph#1857 incorrectly caused each anchor to take up 2 increments and caused the tree (TOC) to increment each anchor too.
@sqs
Copy link
Member

sqs commented Jan 30, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug An error, flaw or fault that produces an incorrect or unexpected result, or behavior. docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants