Professional Notion‑Style HTML Editor
This is a single‑file, professional‑feeling editor designed to behave more like a real Notion‑style workspace and less like a visual demo. Everything you need is embedded in this one HTML document: editor, toolbar, command palette, copy/export tools.
What this page gives you
- A contentEditable editor with headings, paragraphs, lists, and code blocks.
- A toolbar for common formatting (bold, italic, lists, headings).
- A Copy button that copies the editor’s HTML to your clipboard.
- An Export button that downloads the entire page as a self‑contained HTML file.
- A command palette (
Ctrl+K) for quick actions. - An About modal that documents behavior and shortcuts.
Bookmarklet & DevTools context
This editor is designed to help you capture and refine ideas like:
- ✅ How bookmarklets work in Edge/Chromium and other browsers.
- ✅ DevTools console capabilities and constraints.
- ✅ How downloads are triggered from scripts.
- ✅ What’s allowed (and what isn’t) for DOM exports.
Bookmarklet basics
A bookmarklet is simply a bookmark whose “URL” is JavaScript.
javascript:(function(){/* your code */})();
When clicked, it runs on the current page, with the same security rules as any in‑page JavaScript.
DevTools DOM export pattern
A common pattern for exporting the current page DOM to HTML from DevTools looks like this:
(() => {
const html = "<!doctype html>\n" + document.documentElement.outerHTML;
const filename = document.title.replace(/[\\/:*?"<>|]/g, "_") || "page";
const blob = new Blob([html], { type: "text/html" });
const url = URL.createObjectURL(blob);
const link = document.createElement("a");
link.href = url;
link.download = `${filename}.html`;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
})();
This is the same logic the Export button in this page uses, just wrapped for your own notes.
Edge/Chromium behavior
| Behavior | Bookmarklet | DevTools |
|---|---|---|
| Access DOM of current tab | Yes | Yes |
| Trigger download prompt | Yes | Yes |
| Access background tabs | No | No |
| Save multiple tabs automatically | No | No (without extension) |
How to use this editor
- Edit directly in the main area like a Notion page.
- Use the toolbar or
Ctrl+B/Ctrl+Ifor quick formatting. - Click Copy to grab the raw HTML for embedding somewhere else.
- Click Export (or press
Ctrl+S) to save a snapshot of this page as a single HTML file.
This is a self‑contained, professional HTML editor surface meant to feel closer to Notion or a modern documentation tool than to a visual experiment.
Use headings, paragraphs, lists, and code blocks for structured notes.
Copy the editor’s HTML or export this full page as a single HTML file.
Press Ctrl+K to trigger common actions without leaving the keyboard.
No external CSS/JS dependencies; portable and easy to version.
- Copy editor HTML
- Export full page as HTML
- Toggle edit mode
- Open About modal
- Scroll to “Editor intro” card
- Scroll to “Bookmarklets” card
- Scroll to “DevTools & exports” card
Comments
Post a Comment