-
-
Notifications
You must be signed in to change notification settings - Fork 10k
Open respective tab item with URL query string #7008
Copy link
Copy link
Closed
Labels
difficulty: starterIssues that are starter difficulty level, e.g. minimal tweaking with a clear test plan.Issues that are starter difficulty level, e.g. minimal tweaking with a clear test plan.domain: themeRelated to the default theme componentsRelated to the default theme componentsfeatureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.This is not a bug or issue with Docusausus, per se. It is a feature request for the future.status: accepting prThis issue has been accepted, and we are looking for community contributors to implement thisThis issue has been accepted, and we are looking for community contributors to implement this
Description
Metadata
Metadata
Assignees
Labels
difficulty: starterIssues that are starter difficulty level, e.g. minimal tweaking with a clear test plan.Issues that are starter difficulty level, e.g. minimal tweaking with a clear test plan.domain: themeRelated to the default theme componentsRelated to the default theme componentsfeatureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.This is not a bug or issue with Docusausus, per se. It is a feature request for the future.status: accepting prThis issue has been accepted, and we are looking for community contributors to implement thisThis issue has been accepted, and we are looking for community contributors to implement this
Type
Fields
No fields configured for issues without a type.
Have you read the Contributing Guidelines on issues?
Description
Can multi-language support code blocks, support anchors which allow the anchored code block to open?
https://docusaurus-five-rho.vercel.app/docs/markdown-features/code-blocks#multi-language-support-code-block
For example, I would like to be able to offer a user a link, either via the docusaurus side bar, or directly, that allows them to jump to a language specific block.
EG clicking Java https://docusaurus-five-rho.vercel.app/docs/markdown-features/code-blocks#java would navigate to that part of the page and make that tab visible.
This might just be a limitation of my HTML scripting foo, as is possible, if so, please show me the way!
Has this been requested on Canny?
No response
Motivation
we support an open source project which has a significant feature set across multiple language implementations.
I would like to be able to connect this up with syncing tab choices as it would enable readers to ensure they only see information that is relevant to them, in their preferred programming language.
API design
No response
Have you tried building it?
Yes,
See example from docusaurus master, only addition is https://github.com/YOU54F/docusaurus/commit/0e297b966a34e68c4d612a42b1ad3f634d923395 to insert anchors on each of the code block tabs.
Deployed here via vercel however the headers aren't showing
https://docusaurus-you54f.vercel.app/docs/markdown-features/code-blocks
You can clone my master branch
g clone git@github.com:YOU54F/docusaurus.gitnpm install && cd website && npm startHeaders added and visible locally
clicking from TOC will anchor to Javascript tab
If java tab is pre selected and therefore visible
clicking from TOC will anchor to Java tab
Hot linking to any of the code block anchors
http://localhost:3000/docs/markdown-features/code-blocks#javascript even the visible javascript one will take the user to the top of the page.
Self-service