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

Page TOC on right side of page instead of inlined with sidebar #2398

Open
brsanthu opened this issue May 22, 2020 · 4 comments
Open

Page TOC on right side of page instead of inlined with sidebar #2398

brsanthu opened this issue May 22, 2020 · 4 comments

Comments

@brsanthu
Copy link

Feature request

What problem does this feature solve?

These days there are lots of documentation portals are using layout where page toc links are shown on the right and page tree is shown on the left. As of now, vuepress shows page tree as well page toc inlined. Being able to display page toc on right would reduce the left nav tree and can significantly improve the readability of docs.

What does the proposed API look like?

This would be a configuration for default theme.
May be add, pageTocLocation: 'inline' or 'right'

How should this be implemented in your opinion?

The logic where it generates sidebar needs to be updated to factor in pageTocLocation field to skip generating page toc. And then page renderer needs to generate pages with toc on the right.

Are you willing to work on this yourself?

I don't have experience on this but will try.

@brsanthu brsanthu changed the title Page TOC on right Page TOC on right side of page instead of inlined with sidebar May 22, 2020
@Mister-Hope
Copy link
Contributor

Do you mean like this?
image (address)

Here is my project, and feel free to copy any code when you want to use them to contruibute vuepress.

@brsanthu
Copy link
Author

@Mister-Hope Yes.

@xyeLz
Copy link

xyeLz commented Jan 27, 2021

I'm upvoting this as well. I think it would be great to simply include this as a configurable item in the config.js to give the user the flexibility to choose rather than having to custom code a solution. While I understand that this is a somewhat involved project to begin with, having these types of features would absolutely put this above and beyond the competition, especially for those who aren't quite as savvy when it comes to coding (such as myself).

@Anna-mm
Copy link

Anna-mm commented May 12, 2024

Recently I just solve it. I am using vuepress@1.9.10.
First, can show TOC link on the top of the page by using[[toc]] tag in the MD file. In the vuepress 1.x, [[toc]] can be recognize.
Second. use style to move the TOC link from top to right side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants