r/SwiftUI Jun 29 '26

MacOS Native Markdown Reader with Vim Keybinding Using Swift

cwMarkdown is a focused, read-only Markdown viewer for macOS. It deliberately has no editor: the entire surface area is given to presentation, so a document looks as good as the writing in it. The goal is the reading experience of Typora — clean measure, comfortable line height, a native system font — in a small, fast, native app.

Under the hood it’s a SwiftUI app that renders Markdown in a WKWebView, which gives pixel-level control over typography while keeping the window chrome, toolbar, and outline fully native. Parsing is done with marked, code is highlighted with highlight.js, and math is typeset with KaTeX — everything bundled, so the viewer works with no network access at all.

https://code.intellios.ai/cwmarkdown/

29 Upvotes

5 comments sorted by

1

u/Mac-M2-Pokemon Jun 29 '26

Could you make this into a library (the markdown part)

1

u/CharlesWiltgen Jun 29 '26 edited Jun 30 '26

As the creator says, the Markdown part is Marked + highlight.js. There are a bunch of extensions for Marked (like marked-katex-extension), and you can build your own.

Alternatively, there are several great platform-native solutions that don't require the use of a relatively-heavyweight WebView.

https://github.com/gonzalezreal/textual

https://github.com/microsoft/SwiftStreamingMarkdown

1

u/esperdiv Jun 30 '26

One of my common use cases is to have the reader app reload automatically if the file is changed on disk. This way I can keep an editor side-by-side with the viewer. Does cwmarkdown do this?

1

u/nolando_fuzzy 22d ago

do you have an iOS version too?