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

Maybe consider adding Table of Contents support #130

Open
brachkow opened this issue Apr 10, 2023 · 3 comments
Open

Maybe consider adding Table of Contents support #130

brachkow opened this issue Apr 10, 2023 · 3 comments

Comments

@brachkow
Copy link

Hi! We are migrating our big project from vue3-notion to vue-notion, and we stumbled upon the fact that the table of contents is not displayed.

I know that in README table of contents marked as not planned, but it is clearly implementable (see https://github.com/NotionX/react-notion-x that is recommended by OG react-notion) so maybe you consider adding it?

@brachkow brachkow changed the title Table of contents is not visible Maybe consider adding Table of Contents support Apr 10, 2023
@janniks
Copy link
Owner

janniks commented Apr 10, 2023

Sure, 👍 I'll look into it in the next days

@janniks
Copy link
Owner

janniks commented May 9, 2023

Sorry that I still haven’t gotten to this yet

@brachkow
Copy link
Author

brachkow commented Nov 27, 2023

@janniks you can see how I implemented table of contents in our fork — https://github.com/tough-dev-school/vue-notion/blob/main/components/NotionTableOfContents.vue

Code is messy, but I'm sure that you will get an idea.

Keep in mind important thing that I discovered: blockMap order ≠ page block order. Page block order is one which affects order of blocks on page. Using blockMap for that may lead to broken order in Table of Contents.

FYI @zernonia your fork has this bug too: https://github.com/zernonia/vue3-notion/blob/44e0d470530b7de8b3909b3b5081c7aae1d93b99/src/blocks/table-of-contents.vue#L18. And btw, thanks a lot for clever ideas on porting this library.

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

2 participants