Draft
Conversation
Open
- Add export-html.ts utility: inlineImages, buildHtmlDocument, exportAsHtml - Add Export HTML button to ModeToggle (shown in rendered/split modes) - Wire handleExportHtml in NoteEditor via regionRef querySelector - Add .mode-export-btn CSS (matches existing mode-sync-toggle style) - Add unit tests for buildHtmlDocument Closes #52 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add export interface for HTML output
feat: export note as self-contained HTML file
Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an HTML export feature that captures the rendered view of a markdown note and produces a portable, self-contained
.htmlfile. Images are fetched and inlined as base64 data URLs so the export works offline with no external dependencies. PDF export is available via browser print → Save as PDF with no additional work.Changes
apps/web/src/lib/export-html.ts— new utilityinlineImages(html)— parses rendered HTML, replaces<img src>URLs with base64 data URLs; skips existingdata:URLs and silently tolerates fetch failuresbuildHtmlDocument(title, body)— wraps body HTML in a complete HTML5 document with an embedded typography stylesheetexportAsHtml(element, title)— orchestrates the pipeline and triggers a browser<a download>clickapps/web/src/components/mode-toggle.tsxAdds optional
onExportHtmlprop; renders an "Export HTML" button in the floating toolbar when provided (matches existing sync-scroll button style).apps/web/src/components/note-editor.tsxAdds
handleExportHtmlthat queries.rendered-scrollwithinregionRefand callsexportAsHtml. Passed toModeToggleonly whenshowRendered && noteRenderer— the button only appears when the rendered pane is actually visible.apps/web/src/styles.cssAdds
.mode-export-btnstyle consistent with.mode-sync-toggle.