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

sidebar.json does not allow for subcategories #410

Closed
Fl4m3Ph03n1x opened this issue Jan 22, 2018 · 13 comments
Closed

sidebar.json does not allow for subcategories #410

Fl4m3Ph03n1x opened this issue Jan 22, 2018 · 13 comments
Labels
difficulty: intermediate Issues that are medium difficulty level, e.g. moderate refactoring with a clear test plan. feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. status: claimed Issue has been claimed by a contributor who plans to work on it.

Comments

@Fl4m3Ph03n1x
Copy link

Fl4m3Ph03n1x commented Jan 22, 2018

Is this a bug report?

yes

Have you read the Contributing Guidelines?

yes

Environment

OS: MacOS High Sierra
Node: 8.6.0
npm: 5.6.0

Steps to Reproduce

  1. Create an app following docusaurus docs
  2. Try creating a subcategory using the sidebar.json:

{
  "docs": {
    "Docusaurus": ["doc1"],
    "Category 1": {
        "Subcategory": ["doc2", "doc3"]
    },
    "Category 2": ["doc4"]
   },
  "docs-other": {
    "First Category": ["doc5", "doc6"]
  }
}
  1. Launch the website and access documentation

Expected Behavior

I would expect to see the documentation page with a sidebar that contains subcategories.

Actual Behavior

Site blows up with the following error:

Error: Improper sidebars.json file, document with id '[object Object]' not found. Make sure that documents with the ids specified in sidebars.json exist and that no ids are repeated.
    at _loop (/Users/pedro/Workspace/fsort-website/website/node_modules/docusaurus/lib/server/readCategories.js:58:17)
    at readCategories (/Users/pedro/Workspace/fsort-website/website/node_modules/docusaurus/lib/server/readCategories.js:34:53)
    at DocsSidebar.render (/Users/pedro/Workspace/fsort-website/website/node_modules/docusaurus/lib/core/DocsSidebar.js:18:26)
    at /Users/pedro/Workspace/fsort-website/website/node_modules/react-dom/lib/ReactCompositeComponent.js:793:21
    at measureLifeCyclePerf (/Users/pedro/Workspace/fsort-website/website/node_modules/react-dom/lib/ReactCompositeComponent.js:73:12)
    at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (/Users/pedro/Workspace/fsort-website/website/node_modules/react-dom/lib/ReactCompositeComponent.js:792:25)
    at ReactCompositeComponentWrapper._renderValidatedComponent (/Users/pedro/Workspace/fsort-website/website/node_modules/react-dom/lib/ReactCompositeComponent.js:819:32)
    at ReactCompositeComponentWrapper.performInitialMount (/Users/pedro/Workspace/fsort-website/website/node_modules/react-dom/lib/ReactCompositeComponent.js:359:30)
    at ReactCompositeComponentWrapper.mountComponent (/Users/pedro/Workspace/fsort-website/website/node_modules/react-dom/lib/ReactCompositeComponent.js:255:21)
    at Object.mountComponent (/Users/pedro/Workspace/fsort-website/website/node_modules/react-dom/lib/ReactReconciler.js:43:35)

Reproducible Demo

Here is a link to a demo that demonstrates the issue. Simply copy, run npm i on the website folder and you are ready to go:

https://github.com/Fl4m3Ph03n1x/docusaurus-bug-report

@JoelMarcey
Copy link
Contributor

@Fl4m3Ph03n1x Hi!

Just so I am clear, you want a sidebar that looks something like:

CATEGORY 
  - Doc
CATEGORY
  - Doc
  SUB-CATEGORY
      - Doc
CATEGORY
  - DOC

If so, not sure this a bug more of a feature request. Just like with links to anchors in the sidebar, etc. this is a reasonable request. Thanks!

@JoelMarcey JoelMarcey added the feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. label Feb 27, 2018
@Fl4m3Ph03n1x
Copy link
Author

Fl4m3Ph03n1x commented Feb 27, 2018

OHhh, I assumed it was possible but that it was not working as intended. Feature Request it is then!
Your understanding of the issue is correct.

Feel free to check my basic github repo for additional information, I did it with all the coding love in the world :P

Anyway, thanks for acknowledging this ticket! I look forward to seeing this feature implemented !

PS: Now that we established that this is a FR, what are the next steps? Is there any process ?

@JoelMarcey
Copy link
Contributor

Hi @Fl4m3Ph03n1x - You are welcome 😄

The process would be to implement this feature. Would love a PR; otherwise, it will most likely come when we do our next feature set for Docusaurus. Or if I just get some time to do it before that.

@JoelMarcey JoelMarcey added mentorship difficulty: intermediate Issues that are medium difficulty level, e.g. moderate refactoring with a clear test plan. labels Feb 28, 2018
@diboy2
Copy link

diboy2 commented Mar 25, 2018

Hello @JoelMarcey ,
I'm new to contributing, but I want to take on this feature.

@diboy2
Copy link

diboy2 commented Mar 25, 2018

Here's a screenshot of what it will look like in the page.

image

@JoelMarcey
Copy link
Contributor

@diboy2 Hi! I would love it if you wanted to send a PR for this feature. I am a bit confused on the screenshot though. I see a bunch of duplicates in there. For example, why do I see "Site Preparation" three times.

@XzMitsui
Copy link

@JoelMarcey Hello there! I am a newbie who is using docusaurus, I have learned and have created my own website, of course, including the sidebar, but now I want to implement the subdirectory after clicking on the directory in the sidebar, again Let it shrink when clicked. The official documentation of the use of JS makes me confused, I hope you can help me, thank you.

@Fl4m3Ph03n1x
Copy link
Author

@XzMitsui Since this issue is still open, I would assume the feature you are asking was not yet implemented.

@XzMitsui
Copy link

@Fl4m3Ph03n1x Yes,it is. I tried it many times and it didn't work, and a development and maintenance person told me that this feature has not been implemented.

@Fl4m3Ph03n1x
Copy link
Author

Yes,it is. I tried it many times and it didn't work, and a development and maintenance person told me that this feature has not been implemented.

Make up your mind. Either it is implemented or it isn't.
I am stating that this feature is not yet implemented. You start your comment by saying I am wrong only to end it saying I am right.

@XzMitsui
Copy link

@Fl4m3Ph03n1x I don't understand what you mean. I mean, I didn't have a solution after trying it, and then opened up a new Issues, and a maintenance person told me so.

@WillBrock
Copy link
Contributor

It doesn't look like this is being worked on so I'll work on implementing this.

@JoelMarcey JoelMarcey added the status: claimed Issue has been claimed by a contributor who plans to work on it. label Aug 6, 2018
@JoelMarcey
Copy link
Contributor

Thanks @WillBrock!

We've added an "issue: claimed" label so that others will know not to start work on the issue. If you change your mind about the issue, no worries! Just let me know so that we can remove the label and free it up for someone else to claim.

We will check in with you periodically so that we can keep the task updated with the progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: intermediate Issues that are medium difficulty level, e.g. moderate refactoring with a clear test plan. feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. status: claimed Issue has been claimed by a contributor who plans to work on it.
Projects
None yet
Development

No branches or pull requests

6 participants