Repository navigation
NOS: HTML pages and Tiptap-based notes in one workspace #8477
nosworkspace
started this conversation in
Showcase
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Description
I'm building NOS, a workspace where HTML pages and notes sit side by side.
You put an HTML page into NOS. To fix a word or a number, you click that text on the page and type. The change is written back into the original HTML. When the page is ready, you share it as a NOS link. The person you send it to opens it without logging in, and if you edit the page later, the link stays the same. So you don't have to deploy a separate site just to show someone a page.
Your notes live in the same workspace as those pages, and that's where Tiptap comes in.
URL
https://nos-workspace.com
About
Tiptap powers the notes and documents in NOS. It doesn't handle the HTML pages themselves. Those have their own click-to-edit layer that works on the rendered page.
Here's a made-up example of how the two fit together. You keep a product launch page as HTML. Right next to it is a prep note: a task list of copy that still needs changing, a small table of prices to double-check, and a code block with an embed snippet. The page is what you send out, and the note is where you work things out. The note is a Tiptap document.
The editor is built in React with useEditor and EditorContent from @tiptap/react. The schema is StarterKit plus TaskList/TaskItem, Table, CodeBlockLowlight and a few custom nodes of our own. A few details that may help if you're building something similar:
We turn off StarterKit's codeBlock and use CodeBlockLowlight instead. We register only a short, hand-picked set of highlight.js languages rather than the whole library, to keep the bundle small. Code in a language outside that set still shows up, just without colors.
Documents are stored as Markdown. Content is loaded through our own markdownToHtml, and onUpdate turns editor.getJSON() back into Markdown. The catch is that every node in the schema needs a matching case in that converter. Without one, the node is quietly dropped on save, so we keep that rule written right next to the extension list.
For shared editing, the Collaboration extension is added with a Yjs fragment. StarterKit's undoRedo is switched off in that mode so that Yjs handles undo, instead of two undo histories getting out of step.
Type
Document Editor
Other
NOS is a hosted product with free and paid plans. Pasting, editing and previewing an HTML page work without an account. Creating a share link requires logging in.
Disclosure: this post was drafted with help from an AI assistant (Claude).
All reactions