Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MarkView

A fast, native Markdown viewer for Windows — open any .md file and see it rendered exactly like on GitHub, in a clean desktop app that starts instantly.

  • Tiny & fast — the whole app is ~1.3 MB. Native x64 exe, no Electron, no bundled runtime. It uses what Windows already ships: .NET Framework 4.8 and the WebView2 (Microsoft Edge) rendering engine.
  • GitHub-flavored Markdown — tables, task lists, footnotes, strikethrough, autolinks, emoji, inline HTML (<details> etc.), and syntax-highlighted code blocks via highlight.js, styled with GitHub's official markdown CSS.
  • Live reload — edit the file in any editor and the view refreshes automatically, keeping your scroll position. Great as a live preview while writing.
  • Light / dark / auto theme — follows Windows, or pick one. The title bar follows too.
  • Table of contents sidebar with scroll-spy highlighting.
  • Find in document (Ctrl+F) with match counter and highlights.
  • "Open with" integration — one click registers MarkView for .md files (per-user, no admin rights needed).
  • Welcome screen with recent files, drag & drop, zoom, print, export to standalone HTML, copy buttons on code blocks, back/forward navigation between linked .md files.

Quick start

The built app lives in dist\:

dist\
├── MarkView.exe                        ← the app
├── Microsoft.Web.WebView2.Core.dll
├── Microsoft.Web.WebView2.WinForms.dll
├── WebView2Loader.dll
└── assets\                             ← UI + renderer (must stay next to the exe)
  1. Double-click MarkView.exe (or run MarkView.exe path\to\file.md).
  2. Open a file with Ctrl+O, drag & drop, or the welcome screen.

You can move/copy the dist folder anywhere (e.g. C:\Tools\MarkView\) — just keep the exe, the DLLs and the assets folder together.

Make it the default app for .md files

Two options:

  • In the app: menu (⋮ top-right) → Register as default .md viewer. This registers MarkView for .md .markdown .mdown .mkd .mdwn .mdtxt under your user account (no admin needed). If another app currently owns .md, additionally right-click any .md file → Open with → Choose another app → MarkView → Always.
  • Manually: right-click a .md file → Open with → Choose another app → Look for another app on this PC → select MarkView.exe → tick Always.

To undo: menu → Unregister .md file association.

Keyboard shortcuts

Keys Action
Ctrl+O Open file
Ctrl+F Find in document
Ctrl+B Toggle contents sidebar
Ctrl+E Export as standalone HTML
Ctrl+P Print
Ctrl+= / Ctrl+- / Ctrl+0 Zoom in / out / reset (also Ctrl+mouse wheel)
Alt+← / Alt+→ Back / forward (when following links between .md files)
F5 Reload file
PgUp/PgDn/Home/End/Space/↑↓ Scroll

Building from source

No SDK or IDE required — the build uses the C# compiler that ships inside Windows (.NET Framework 4.8, present on every Windows 10/11 machine).

powershell -ExecutionPolicy Bypass -File .\build.ps1

That's it. The script:

  1. compiles tools\IconGen.cs and runs it to generate the app icon (build\app.ico),
  2. compiles everything in src\ into dist\MarkView.exe (x64, optimized),
  3. copies the WebView2 DLLs (lib\) and the assets\ folder into dist\.

Project layout

md_file_viewer\
├── src\                    C# host application (.NET Framework 4.8, WinForms)
│   ├── Program.cs            entry point
│   ├── MainForm.cs           window, WebView2 wiring, file loading/watching, IPC
│   ├── AppSettings.cs        JSON settings in %APPDATA%\MarkView
│   ├── FileAssociation.cs    per-user registry registration for .md files
│   └── app.manifest          Per-Monitor-V2 DPI awareness
├── assets\                 the viewer UI (runs inside WebView2)
│   ├── index.html            app shell
│   ├── app.css               chrome styles (light + dark)
│   ├── app.js                rendering pipeline, TOC, find, IPC with the host
│   └── vendor\               markdown-it, highlight.js, DOMPurify, GitHub CSS
├── tools\IconGen.cs        generates the multi-size .ico at build time
├── lib\                    WebView2 SDK assemblies (from the official NuGet package)
├── build.ps1               build script
└── dist\                   build output — the distributable app

How it works

The C# WinForms host owns the window and everything native: command-line/drag-drop file input, an atomic-save-tolerant FileSystemWatcher for live reload, encoding-detecting file reads, settings, dialogs, zoom, and the registry work for file associations.

Rendering happens inside a single WebView2 control. Markdown is parsed by markdown-it (with task-list and footnote plugins), highlighted by highlight.js, sanitized by DOMPurify (so a malicious .md can't run script), and styled with github-markdown-css. Host ⇄ UI communication uses postMessage JSON both ways. Images referenced by the document are served through a WebResourceRequested handler, so relative paths (./img/x.png, ../shared/y.png) work from anywhere on disk. Web links open in your default browser; links to other .md files open in the viewer with back/forward history.


Requirements & troubleshooting

  • Windows 10/11 (x64) with .NET Framework 4.8 — preinstalled on Windows 10 1903+ and all Windows 11.
  • WebView2 Runtime — preinstalled on Windows 11 and on any machine with Microsoft Edge. If MarkView reports it missing, install the free Evergreen WebView2 Runtime.
  • "Windows protected your PC" (SmartScreen) — the exe is unsigned; click More info → Run anyway, or unblock the file in Properties.
  • Settings live in %APPDATA%\MarkView\settings.json; browser cache in %LOCALAPPDATA%\MarkView\WebView2Data. Delete both to reset completely.

Third-party components

Component License Used for
markdown-it (+ task-lists, footnote plugins) MIT Markdown → HTML
highlight.js BSD-3-Clause Code syntax highlighting
github-markdown-css MIT GitHub-style typography
DOMPurify Apache-2.0 / MPL-2.0 HTML sanitization
Microsoft WebView2 Microsoft license Rendering engine

MarkView itself is released under the MIT License (see LICENSE).

About

MarkViewer is simple opensource markdown view program develop for windows (10+)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages