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: Examples tab #322

Merged
merged 24 commits into from
Sep 13, 2023
Merged

docs: Examples tab #322

merged 24 commits into from
Sep 13, 2023

Conversation

matthewlipski
Copy link
Collaborator

This PR adds a new tab to the docs website for examples. Currently there are 3 basic examples and 3 advanced ones, though the organization might change and more will be added over time.

@vercel
Copy link

vercel bot commented Aug 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
blocknote-website ✅ Ready (Inspect) Visit Preview Sep 13, 2023 3:03pm

Copy link
Collaborator

@YousefED YousefED left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General feedback; I think it would be nice if the examples can be bigger in terms of screen space for the editor / preview. More like https://vuejs.org/examples/#hello-world, but not sure if this is doable

packages/website/docs/examples/alert-block.md Show resolved Hide resolved
packages/website/docs/examples/alert-block.md Show resolved Hide resolved
packages/website/docs/examples/alert-block.md Show resolved Hide resolved
editor.getTextCursorPosition().block,
"after"
);
editor.setTextCursorPosition(editor.getTextCursorPosition().nextBlock!);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be cleaner if we can use either the inserted block, or a return value from insertBlocks to set the text cursor position. editor.getTextCursorPosition().nextBlock! feels hacky

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

insertBlocks can insert multiple blocks though, so it gets pretty cumbersome if e.g. the inserted blocks don't have IDs (which is usually the case), since you have to retrieve all the blocks again after you insert them, and can't do it by ID. So I think it's actually quite a bit of work to implement properly, especially since it would make sense to do the same thing for updateBlock, replaceBlocks, etc

packages/website/docs/examples/alert-block.md Show resolved Hide resolved
packages/website/docs/examples/alert-block.md Outdated Show resolved Hide resolved
packages/website/docs/examples/alert-block.md Show resolved Hide resolved
packages/website/docs/examples/block-from-tiptap.md Outdated Show resolved Hide resolved
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

Successfully merging this pull request may close these issues.

None yet

2 participants