Payas Editor
A modern, multi-tab WYSIWYG rich-text editor that saves as clean Markdown. No frameworks. No server. No tracking. Just write.
What is Payas Editor?
Payas Editor is a single-file web application — open
payas-editor.html in any modern browser and you instantly have a
fully-featured writing environment. It works completely offline, stores everything
in your browser, and exports clean Markdown files.
Writers & Bloggers
Draft posts with rich formatting, export to Markdown for static site generators.
Developers
Take notes with code blocks; edit .md files without a heavy IDE.
Students
Write assignments locally — no account, no cloud, no data leaks.
Privacy-Focused
Zero telemetry. Nothing leaves your device. Ever.
Core Philosophy
| Principle | What it means for you |
|---|---|
| Privacy first | Nothing is sent to any server |
| Zero runtime dependencies | No CDN calls needed after first load |
| Portable | Copy one HTML file anywhere and it works |
| WYSIWYG → Markdown | Write naturally; get clean Markdown output |
Getting Started
Open the Editor
Double-click payas-editor.html
That's it. No installation, no build step, no terminal.
localhost or HTTPS.Your First Document
- The editor opens with a blank Untitled tab ready to type
- Start writing — the toolbar gives you formatting options
- Press Ctrl+S to save as a
.mdfile - Press ? anytime to see all keyboard shortcuts
Open an Existing File
Click Open in the toolbar (or drag-and-drop a .md
or .txt file into the editor window) to load an existing document.
Interface Overview
Toolbar Sections
| Section | Buttons | Purpose |
|---|---|---|
| Navigation | Sidebar toggle, New, Open | Manage documents |
| Save | Save, Save All, Export | Write files |
| Inline Format | B, I, U, S̶ | Text style |
| Block Format | H1–H6, ¶, Code, Quote | Block type |
| Insert | Link, Image, Table, HR | Insert elements |
| List | UL, OL, Indent, Outdent | List controls |
| Align | Left, Center, Right, Justify | Text alignment |
| View | Write, Split, Preview | Layout mode |
| Utility | Find, Theme, Settings, Keys, About | App controls |
Editing Features
Text Formatting
| Format | Keyboard | Markdown Output |
|---|---|---|
| Bold | Ctrl+B | **text** |
| Italic | Ctrl+I | *text* |
| Underline | Ctrl+U | <u>text</u> |
| — | ~~text~~ | |
Inline Code | Ctrl+` | `text` |
| Text Color | — | <span style="color:…"> |
| Highlight | — | <mark style="…"> |
Block Formatting
| Block | Shortcut | Markdown |
|---|---|---|
| Heading 1 | Ctrl+Alt+1 | # Title |
| Heading 2 | Ctrl+Alt+2 | ## Title |
| Heading 3–6 | Ctrl+Alt+3–6 | ### … |
| Paragraph | Ctrl+Alt+0 | plain text |
| Code Block | Ctrl+Alt+C | ```…``` |
| Blockquote | Ctrl+Alt+Q | > text |
Inserting Elements
- Links: Click the link icon → enter URL and display text → inserts
[text](url) - Images: Click the image icon → enter URL and alt text → inserts
 - Tables: Click the table icon → choose rows/columns → inserts a Markdown table
- Horizontal Rule: Inserts
--- - Task Items: Click the checkbox icon to add
- [ ] taskitems - Drop Cap: Decorates the first letter of the selected paragraph
Lists
- Click UL for a bulleted list (
-) or OL for a numbered list (1.) - Use Tab to indent a list item (creates nested list)
- Use Shift+Tab to outdent
- Press Enter twice to exit the list
View Modes
Switch between three layouts using the buttons in the top-right of the toolbar.
Write Mode
Full-width editor. No distractions. Just type. This is the default mode.
Split Mode
Side-by-side: editor on the left, live Markdown preview on the right. Drag the divider to resize.
Preview Mode
Read-only Markdown render. Check how your document looks when published.
Tab Management
Payas Editor lets you work on many documents at once — each in its own tab.
Tab Operations
| Action | How |
|---|---|
| New tab | Click + in the tab bar, or press Ctrl+T |
| Close tab | Click × on the tab, or press Ctrl+W |
| Switch tab | Click a tab, or use Ctrl+Tab / Ctrl+Shift+Tab |
| Rename tab | Double-click the tab name |
| Duplicate tab | Right-click → Duplicate |
| Reorder tabs | Drag a tab to a new position |
Sidebar
Press Ctrl+\ or click the sidebar button to toggle the document list panel. Use the search box at the top to filter tabs by name. A dot indicator shows which tabs have unsaved changes.
Auto-Save
All tab content is saved to your browser's localStorage automatically
every 30 seconds. If your browser closes unexpectedly, your work is recovered on next open.
.md file.
Use Ctrl+S to write a file to disk.Find & Replace
Press Ctrl+F to open the Find & Replace panel.
- Find: Type to instantly highlight all matches in the document
- Case Sensitive: Toggle to match exact casing
- Replace: Enter a replacement string
- Replace: Swap the current match
- Replace All: Swap every match in the document at once
- Prev / Next: Navigate between matches
Press Escape to close the panel.
Export & Save
Save as Markdown — Ctrl+S
Converts editor content to clean Markdown and downloads a .md file.
The filename defaults to the tab name.
Export Formats
Click Export in the toolbar to choose a format:
| Format | Extension | Contents |
|---|---|---|
| Markdown | .md | Clean Markdown syntax |
| Plain Text | .txt | Content without any markup |
| HTML | .html | Styled, self-contained web page |
Keyboard Shortcuts
Press ? in the editor to open the interactive shortcut reference.
File Operations
Navigation
Text Formatting
Settings & Customization
Click the Settings (gear) icon to open the preferences panel.
Appearance
| Setting | Options | Default |
|---|---|---|
| Theme | Light / Dark | Light |
| Editor Font Size | 11–24 px | 15 px |
| Line Height | 1.3–2.4 | 1.8 |
| Editor Width | Full, 820 px, 680 px | 820 px |
| Sidebar Width | 200 / 240 / 280 / 320 px | 240 px |
Behavior
| Setting | Default | Description |
|---|---|---|
| Spell Check | On | Browser spell checker underlines typos |
| Auto-Save | On | Saves to localStorage every 30 s |
| Focus Mode | Off | Hides toolbar while typing |
| Live Markdown Sync | On | Refreshes preview as you type |
| Confirm on Close | On | Warns before closing unsaved tabs |
All settings are saved automatically and persist between sessions.
Offline & PWA Support
Payas Editor includes a Service Worker (sw.js) that
caches all necessary assets after the first visit.
What This Means
- Open the editor once while online — it downloads itself
- On every subsequent visit, it loads instantly even with no internet connection
- Google Fonts are cached after first fetch for offline typography
Install as a Native App
When served over HTTPS or localhost, browsers offer an "Install" prompt:
| Browser | How to Install |
|---|---|
| Chrome / Edge | Click the install icon in the address bar |
| Safari (iOS) | Share → Add to Home Screen |
| Android (Chrome) | Browser menu → Add to Home Screen |
For Developers
This section covers the internals for contributors or developers who want to understand, embed, or extend Payas Editor.
Project Structure
Technology Stack
| Layer | Technology |
|---|---|
| UI | Vanilla HTML5 + CSS3 (custom properties) |
| Logic | Vanilla ES2020 JavaScript |
| Rich Text | contenteditable + Selection API |
| Persistence | localStorage |
| Offline | Service Worker (Cache API) |
| Icons | Bootstrap Icons 1.11.3 (local) |
| Fonts | JetBrains Mono, Fraunces, DM Sans |
Code Architecture
Everything lives in payas-editor.html, organized in clearly labeled sections:
Performance Strategy
| Operation | Strategy | Timing |
|---|---|---|
| Toolbar state sync | requestAnimationFrame debounce | ≤ 16 ms |
| Status bar update | Debounce | 150 ms |
| Markdown preview | Debounce | 300 ms |
| Auto-save | Change-signature check + interval | 30 s |
localStorage Keys
| Key | Contents |
|---|---|
payas-tabs | JSON array of all open tab objects |
payas-active-tab | ID of the currently focused tab |
payas-settings | JSON object of user preferences |
payas-split-ratio | Float (0–1) for split pane divider position |
Adding a New Toolbar Button
- Add a
<button>inside#toolbarwith atitleattribute andbi-*icon class - Add a click handler in the script section using
addEventListener('click', ...) - Call
document.execCommand(...)or manipulate the Selection/Range API - If the button state should reflect cursor context, add it to
syncToolbar()
Extending the Markdown Converter
The converter entry point is toMarkdown(element). serializeNode(node, context)
is called recursively. To support a new HTML element, add a case inside the
switch (node.nodeName) block:
case 'YOUR-TAG':
return `your-markdown-syntax${children}your-markdown-syntax`;
Updating the Service Worker Cache
After releasing new files, bump CACHE_NAME at the top of sw.js
to force all clients to re-download:
const CACHE_NAME = 'payas-editor-v4'; // increment on each release
Deploying
There is no build step. Copy the entire directory to any web server or CDN. The application is a single static file bundle.
# Serve locally for PWA testing
npx serve .
# or
python3 -m http.server 8080
FAQ
Is my data safe?
Yes. Everything stays in your browser. No data is sent to any server. There is no analytics, no telemetry, and no user accounts.
Where are my files stored?
In-progress work is stored in localStorage. Exported files go to
your Downloads folder as regular files on your computer.
Can I use it on mobile?
Yes. The UI is fully responsive. For the best experience, install it as a PWA from Safari (iOS) or Chrome (Android) to get a native app feel.
What happens if I clear my browser data?
localStorage is wiped, so unsaved tabs are lost. Always export important
documents as .md files to keep permanent copies on disk.
Does it support Markdown extensions (tables, task lists)?
Yes — GitHub-Flavored Markdown (GFM) including tables, task lists, strikethrough, and fenced code blocks are all supported.
Can I open multiple browser tabs with the editor?
Yes, but localStorage is shared between tabs, so changes in one browser tab may overwrite another. Use the in-app multi-tab system instead.
The editor is slow with very large documents. Why?
The Markdown preview does a full DOM walk on every keystroke (debounced to 300 ms). For very large files (100k+ words), switch to Write mode to disable the live preview and regain speed.
How do I contribute?
The project is MIT-licensed. Open an issue or pull request on the project repository. Contributions for new features, bug fixes, and documentation are all welcome.
License
Payas Editor is released under the MIT License.
MIT License
Copyright (c) Saman Udayanga Wijesinghe
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Third-Party Credits
| Package | License |
|---|---|
| Bootstrap Icons | MIT |
| JetBrains Mono | OFL 1.1 |
| Fraunces | OFL 1.1 |
| DM Sans | OFL 1.1 |