-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
Allow linking to hrefs for Sidebars #827
Comments
Claimed by @SleepWalker |
Removing the "issue: claimed" label due to inactivity. With the changing of sidebar format in #1026, we now can easily add external links type into the sidebar. This issue should be now a little simpler. |
Could I try taking on the issue? I'm looking for an opportunity to contribute to an open source project for the first time! |
Hello @syn228, I was busy a few weeks, but I want to finish with the issue, I've claimed.. I'm planning to return to this issue today or tomorrow. |
#892 and #1026 should be super related to this Sidebar item - subcategory
Sidebar item - url/href
Sidebar item - doc id (default)
Eventually we have
|
@endiliey, I've come up with the following format: {
"docs": {
"Category 1": [
{
"type": "link",
"label": "Github",
"href": "http://github.com"
},
{
"type": "ref",
"id": "intro"
},
{
"type": "category",
"label": "Subcategory 1",
"items": [
"foo/bar",
"foo/baz"
]
},
{
"type": "category",
"label": "Subcategory 2",
"items": [
"hello"
]
}
],
"Category 2": ["code"]
},
"test": {
"test": [
{
"type": "doc",
"id": "intro"
},
{
"type": "ref",
"id": "code"
}
]
}
}
|
…her sidebars. Closes facebook#827, facebook#868
…her sidebars. Closes facebook#827, facebook#868
@yangshun should this feature implemented for v1 too? I've read, that you're not accepting new features for v1 |
@SleepWalker If it's easy to support this for v1, I think we should do it. Seems like it should be doable on v1 too. I added the |
@syn228 Sorry about this, could you try looking for other issues to work on? Facebook has other open source projects as well which would be glad to receive your contributions. |
Any idea when this would be coming? I'd prefer also the possibility to link to custom pages (though of course I can do that with href as well). We are generating our API documentation using ReDoc, which would be well suited to be a custom page. |
Would like to be able to reference |
Hi Folks, |
Probably not too hard to fix in v1. |
Hi, will take a look. For v1, should it be fixed on master or there's another branch? |
@slorber |
@sriramgroot The solution to this problem may not be trivial. Could you move to v2? Or is something stopping you from that? |
Pain point
For developers that generate API documentation from their code, it would be useful for Docusaurus to allow linking to these pages from a sidebar.
How it currently works
Normally we only allow links to hrefs via the top level navigation. This feature would allow for more flexibility on single navigation pages.
How it would work
Use a similar for processing-method for
sidebar.json
as the one we use to handle external links insiteConfig.js
headerLinks
. This would add a new branch of code when processingsidebar.js
and encountering anhref
and no associatedid
field. If anid
field is present, then it should take precedence.Scope of impact: Low to Mid
Any project that uses documentation generation from code could benefit from this feature.
The text was updated successfully, but these errors were encountered: