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

Docs sidebar should be configuration less #1178

Closed
krishnasaga opened this issue Jan 3, 2019 · 3 comments
Closed

Docs sidebar should be configuration less #1178

krishnasaga opened this issue Jan 3, 2019 · 3 comments
Labels
closed: wontfix A fix will bring significant overhead, or is out of scope (for feature requests)

Comments

@krishnasaga
Copy link

krishnasaga commented Jan 3, 2019

🚀 Feature

In a simple case, docs sidebar should to derived without the sidebars.json configuration file. by following a convention on directory structure and file naming.

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

Motivation

Reduce the configuration required. Allow users to add a documentation page without touching multiple files.

Pitch

if docs property is not present in sidebars.json then assume each directory inside a docs folder is a category and each folder contain files in PascalCase so pascal-case will be URL slug. and Pascal Case will be a title.

@yangshun
Copy link
Contributor

yangshun commented Jan 3, 2019

This approach involves quite a big of magic (reminds me of Rails) which makes Docusaurus usage less obvious and becomes harder to understand. I think being explicit is better.

Another issue with this approach is the ordering of the files within a category. How would you define the ordering if you don't have the sidebars.json? Alphabetical ordering is usually not what users will want.

@krishnasaga
Copy link
Author

krishnasaga commented Jan 4, 2019

I think being explicit is better

I agree that being explicit is better as it makes even program logic more obvious ( because of that I don't prefer Regex in some cases. it will give transparent flexibility over unmatured constraints )

and I think this case will not make unobvious as no config is just a fallback only when the user doesn't have a docs entry in sidebars.json.

To summarise
When there is no explicit config in sidebar.json the config is dir tree structure
When there is explicit config in sidebar.json the config is tree defined that in config file

Both cannot co-exist.

Alphabetical ordering is usually not what users will want.

If the user wants more flexibility he should invest in explicit configuration. But if the user wants just his docs to be shown on his site and alphabetical ordering is making more sense for that user then he no need to do any configuration.

one more thing is documentation tool is not the only tool a user uses. so they have to deal with so many things and many configs. and they no need to make everything in their app 100% perfect in first place. In most times they need an MVP. and more flexibility comes with more config.

@endiliey
Copy link
Contributor

endiliey commented Mar 6, 2019

Remind me of webpack. Too much configuration. I think this is quite a good idea, but definitely not a high priority for now (we should focus on v2 :( )

If anyone want to implement this, we’ll be happy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: wontfix A fix will bring significant overhead, or is out of scope (for feature requests)
Projects
None yet
Development

No branches or pull requests

4 participants