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

option to put sidebar on the right #1282

Open
trusktr opened this issue Jul 13, 2020 · 3 comments
Open

option to put sidebar on the right #1282

trusktr opened this issue Jul 13, 2020 · 3 comments

Comments

@trusktr
Copy link
Member

@trusktr trusktr commented Jul 13, 2020

Feature request

An option to put the sidebar on the right instead of the left

What problem does this feature solve?

Sometimes people want it on the other side (maybe they embed Docsify somewhere that already has a sidebar on the left, or maybe they have a custom landing page with a custom menu on the right and when they click the link to go to documentation they'd also want the docs to have the sidebar on the same side).

What does the proposed API look like?

rightSidebar: true // or false

or

sidebarPosition: 'right' // or 'left'

How should this be implemented in your opinion?

I think we might be able to achieve this just with CSS, leaving the markup alone.

cc @jhildenbiddle for CSS expertise here.

Are you willing to work on this yourself?

Of course (if/when I get the time)!

@project-bot project-bot bot added this to Needs Review in Triage Jul 13, 2020
@trusktr trusktr added this to To do in 4.x via automation Jul 13, 2020
@trusktr trusktr removed this from Needs Review in Triage Jul 13, 2020
@anikethsaha
Copy link
Member

@anikethsaha anikethsaha commented Jul 13, 2020

+1 for this.

@trusktr
Copy link
Member Author

@trusktr trusktr commented Jul 13, 2020

Turns out it was easy to do, it took only a few minutes to modify 3 numbers in the CSS:

Of course the menu icon should be re-positioned too.

I'll make a draft PR once I circle back (I'd like to finish the SSR tests in the other PR).

@jhildenbiddle
Copy link
Member

@jhildenbiddle jhildenbiddle commented Jul 14, 2020

I think this is a feature best targeted for v5 and discussed in that context.

There's more to consider than just making the menu appear on the right:

  • How are other docsify themes affected?
  • How are third-party themes affected?
  • How are third-party plugins affected (i.e. do any rely on the sidebar-on-left behavior)?
  • If the sidebar slides in from the right, should the sidebar toggle also be located on the right?
  • How does this behavior look at desktop resolutions?

These are just off the top of my head. I'm sure there are more.

More importantly, not every preference needs to be a core docsify feature. Is this feature useful? Possibly, but given the fact that it has never before been requested in the nearly four years that docsify has existed, I think it's safe to say that this is not a high priority feature. I'd look to our existing issues list and feature requests to get a better idea of where we should be focused.

The good news is that folks that want a sidebar on the right can do so today by adding a custom <style> tag to their index.html file with the tweaked values you mentioned above. No need to wait for a new docsify option. We can target this issue for v5, see what kind of activity it gets, and determine if/how to implement this feature in v5 when the time comes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
4.x
  
To do
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.