-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
V2: document docs plugin multi-instance #3299
Comments
P.S. I think this configuration is not intuitive, so it can be seen as a suggestion for simplification. |
Hey @NikitaIT The docs multi-instance system is brand new, it wasn't working before alpha 61, and we can definitively improve the doc (I left it undocumented on purpose so that we can get a bit of feedbacks of early adopters before writing some doc. Both options look valid to me, but it will also depend on how you see versioning working on your site, and what URLs you want. If you have 2 plugin instances, each can have different versionion schemes (ios/android sdks for example). Also each plugin instance has its own URL prefix. One plugin instance means shared URL prefix + same versioning for both docs. Also worth mentioning that you can use special navbar items to link to docs: https://v2.docusaurus.io/docs/theme-classic/#navbar-docs-version-dropdown Also, if you use docs, it means you want to use doc navigation, a sidebar etc... If you don't need that, you can also simply created a markdown page (added recently): https://v2.docusaurus.io/docs/creating-pages/#add-a-markdown-page If you want to write some doc, I'll be happy to accept a PR |
About 2 docs with versionsIt seems setting id in the classic with versioning is unnecessary, and breaks the documentation. So I remove |
Sorry but I don't understand what you mean 😅 if you can send a PR to Docusaurus website that allows me to see the problem on the deploy preview that would be helpful. |
@slorber This is not very important, just when adding folders with versions, the second instance of the plugin docs parses them again(without disableVersioning). Because both plugins do it at the same time, this leads to an error. The error is expected, but I decided to write about it here, just in case. |
Thanks @NikitaIT for a great tutorial on getting multiple, separate and unique, documentation pages! |
I tested out method 1 on a clean install, and it returns a 404 error when navigating to Resources. I did find a method that worked using multiple sidebars. sidebars.js
inside of /docs
docusaurus.config.js
|
I was able to get three different "docs" sections added while running version 2.0.0-alpha-64. They each have sub-directories, and custom sidebars. Worked really well once I finally figured it all out. Often, when I added new docs into new sub-directories, I had to restart yarn for the new files to be recognized. Other than that, if this was explicitly documented it would have saved me at least an hour of fidgeting and guessing.
|
sorry about that, I keep in mind to write this doc soon :) |
@slorber Not a problem at all, and not a complaint. Just wanted to chime in to validate that it's working and worth some solid docs. V2 really is slick, great work! |
@mathetos @slorber Have you remove the By the way:
As result no |
FYI I just added documentation for the multi-instance support. Can early adopters read it and tell me if something is not clear enough please? |
@slorber I haven't tested your sample code, but when I was working on mine above back in September, I couldn't get the relative path to work correctly as you have it in your snippet, which is why in mine above the path is Other than that, the doc looks great! |
@mathetos that's surprising because the default path is actually just Thanks for the feedback |
📚 Documentation
Usecase
As a developer, I want to be able to create 2 pages of documentation.
Why am I writing this?
This is often necessary, and oftentimes developers don't find the right way to do it. One of the official examples from the examples page in the documentation:
Expected result
The image shows the expected result - two pages with two sidebars.
Docs
with url/docs
and index-page on/docs/doc1
from dirdocs
.Resources
with url/resources
and index-page on/resources/doc2
from dirresources
.Solution
Warning: md-link from resources to docs should be relative like
[doc1](../docs/doc1)
Then need to create files from
docusaurus.config.js
folder:Then need to connect two
content-docs
plugins (one frompreset-classic
) with different ids.And set routes to
themeConfig.navbar.items
.Alternative expected result
Docs
with url/docs
and index-page on/docs/doc1
from dirdocs
.Resources
with url/docs/resources
and index-page on/docs/resources
from dirdocs/resources
.Solution
Warning: not tested with docs versions
Then need to create files from
docusaurus.config.js
folder:Then need to connect two
content-docs
plugins (one frompreset-classic
) with different ids.And set routes to
themeConfig.navbar.items
withactiveBaseRegex
.The text was updated successfully, but these errors were encountered: