question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proposal: auto generate sidebar

See original GitHub issue

Auto-generate sidebar

Summary

Auto-generate and update the sidebar i.e _sidebar.md by looking into the folders/files

Motivation

If you have a big project or a project having many markdown files. It is kind of extra work look for each file and writes the path and the file name and the text to display it. Maximum projects I have seen take each .md file as a single page and .md files under a folder inside the docs directory is a sub-page. So if we go with usual lookups through each file/folder. This is quite easy to achieve.

Detailed Design

No changes are required in the core. Only needs changes in cli. New command probably

If we have directories like this

|- <root>
       |- README.md
       |- index.html
       |- _sidebar.md
       |- a.md
       |- guide
            |- guide-a.md
       |- b.md

The sidebar command should generate the following

- [a](./a.md)
- guide
  - [a](./guide/guide-a.md)
- [b](./b.md)

We need to traverse through the directory and create an object or tree and then just print the tree as a list in the markdown.

Documentation

Update the docs in the main docs site as a separate page and create docs for the command in the cli and do a remote rendering of the page in the main docs

Drawbacks

Few

  • It won’t know whether markdown file should be in the heading or in subheading if it goes out of our prediction.
  • cant do the operation for the .html files.

Backwards Compatibility Analysis

Not required as no changes in the core is being done.

Alternatives

Do the manual entry in the _sidebar.md

Open Questions

  • Should we wait for or put this in v5 ?
  • Any volunteers for taking this ?

Help Needed

None.

Frequently Asked Questions

None

Related Discussions

Couldnt find any.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:14
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sy-recordscommented, Jan 27, 2022

Ok, I will add it later.

Added it in docsify-cli before

see https://github.com/docsifyjs/docsify-cli#generate-command

1reaction
trusktrcommented, Jan 26, 2022

@sy-records already added an initial version of this to docsify cli in https://github.com/docsifyjs/docsify-cli/pull/130

Sy, can you update the docs here for docsify.js.org? (might be a good reason to have cli in the same repo, so we can update the docs in the same pull request, etc).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Automatic sidebar creation for wiki (#379144) · Issues - GitLab
Automatic sidebar creation for wiki. Proposal. The Wiki doesn't have a way to generate sidebar based on existing wiki files and the existing ......
Read more >
How to Add or Edit a Sidebar in WordPress - YouTube
Not a fan of WordPress's built in sidebars? Don't worry, today you'll learn how to create a custom sidebar that will work for...
Read more >
Configure Your Sidebar - Faithlife Help Center
The Sidebar tab allows you to customize your Faithlife page by adding or removing interactive widgets ... Any changes you make will be...
Read more >
Sidebar - Docusaurus
Docusaurus can create a sidebar automatically from your filesystem structure: each folder creates a sidebar category, and each file creates ...
Read more >
CSS Sidebars: A Beginner's Guide - HubSpot Blog
This works well, but what if you want the same sidebar elements to be in view at all times? In this case, you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found