A local markdown editor for Windows. Source on the left, live preview on the right, and a dark theme that stays out of the way.
It's a Flask server and a pywebview window — no Electron, no network access, no accounts.
- Live preview with full CommonMark and GitHub-flavored markdown
- Syntax highlighting for JavaScript/TypeScript, Python, CSS, JSON and shell
- Tables, task lists, footnotes, definition lists, and YAML front matter
- Registers as an "Open with" handler for
.mdfiles - Opening a second file reuses the window that's already open
- Autosave, with edits to disk-backed files written straight back
- Recently-closed list, so a closed document can be restored
Grab the latest build from Releases, unpack it, and run
MD_Editor.exe. Keep _internal next to the exe — it holds the Python runtime
and the front-end files.
pip install flask pywebview
python main.py
Python 3.10 or newer.
pip install pyinstaller
pyinstaller MD_Editor.spec
The result is dist\MD_Editor\MD_Editor.exe.
This is a onedir build on purpose. A onefile build unpacks its whole archive
into %TEMP% on every launch, and the virus scanner re-reads those fresh files
each time, which made startup take four to seven seconds instead of about 1.4.
Note that build\MD_Editor\MD_Editor.exe also appears during a build. That one
is a bootloader stub with no _internal beside it and will not run — always
launch the copy under dist\.
main.py starts the Flask server on port 5177, then opens a pywebview window
pointing at it. If that port is already serving another MD Editor, the new
launch hands over its file and skips starting a second server.
server.py serves the editor and exposes a small API: /api/startup-file for
the file the app was opened with, /api/open-file for handoff between
instances, and /api/save-file for writing edits back to disk.
The front end is a single mdeditor.html. Markdown is rendered by markdown-it,
bundled into vendor.js.
A .md opened from disk is tied to its path and saves back to that file.
A document created with "+ New" lives only in the editor's local storage and has no file on disk. There's no Save As yet, so treat those as scratch notes.
CommonMark and GFM, via markdown-it, plus footnotes, definition lists,
abbreviations, subscript, superscript, ++inserted++, ==highlighted==, and
:emoji: shortcodes. YAML front matter is recognised and hidden.
Raw HTML is escaped rather than rendered. That's a deliberate choice: the save endpoint writes to any path it's given, so letting a markdown file inject markup would turn a downloaded note into arbitrary file access.
vendor.js is a bundle of markdown-it and its plugins. Edit vendor.entry.js,
never vendor.js. The exact npm and esbuild commands are in the header of
vendor.entry.js.
MIT. See LICENSE.