A more robust and extended markdown viewer/editor

Hey all,

Saw a few threads recently about people having issues with markdown in DOpus, and I’d hit the same wall myself. The PowerToys handler kept throwing errors for me too. So I built my own viewer a while back to scratch the itch, and spent today tidying it up to make it a bit more accessible and compatible. Thought I’d share in case it’s useful to anyone else here.

It's WebView2-based and does more than the existing options. Three core modes:

  • Reading - clean rendered HTML
  • Live - the formatting stays visible until your cursor enters a line, then the raw markers reveal just for that line
  • Source - raw markdown, with an optional split pane inside the viewer (source left, live preview right, draggable handle, link/unlink scroll sync)

hero-forum

Why it shouldn't randomly quit on you

It works around the WebView2 DPI bug that trips up the PowerToys handler, and deals with the cases the existing plugin chokes on, so it should stay up.

Editing

  • Full formatting toolbar: bold, italic, strikethrough, highlight, inline code, link, footnote, a cycling heading button (H1 to H6), bullet / numbered / task lists, indent, quote, code block, image insert
  • Reorder or hide toolbar buttons, and set either toolbar to auto-hide (sweep the edge to bring it back)
  • Right-click context menu in any mode
  • Syntax highlighting in all three modes (js, ts, python, rust, go, c/cpp, sql, json, yaml, shell, powershell and more), with a copy button on every rendered code block
  • Word-wrap toggle for long code lines and URLs

Saving and files

  • Save and Save As, in the viewer pane or popped out into its own window (double-click a .md)
  • Conflict-aware auto-save: if another app changed the file underneath you, it backs off instead of clobbering it
  • Unsaved-edit persistence: switch to another file with unsaved edits and it holds them, click back to keep them or reload from disk
  • Line-ending aware: optional LF / CRLF badge at the end of each line, and your file's endings are preserved on save
  • In-app updater: checks the repo for a newer build and installs it, no manual quit / extract / reinstall

Images

  • Insert popup: pick a file or paste a URL, set alt text, width / height, alignment. URL images download into the document folder (with magic-byte type sniffing) so your markdown stays self-contained
  • Remote-image privacy gate (off by default): https image URLs render as a placeholder and make no network request, so the host can't tell you opened the document
  • Obsidian-style sizing syntax works, e.g. ![alt|400x300](path)

Themes

  • 29 built-in palettes (17 dark, 12 light: Dracula, Nord, Gruvbox, Tokyo Night, Catppuccin, Solarized and so on), or save your own
  • The whole UI re-tints to the active palette: toolbars, selection, scrollbars and the syntax highlighting. Code colours can follow the palette automatically, or you can pin a specific syntax theme

Language and encoding

  • Auto-detects UTF-8 / UTF-16 (LE/BE) via BOM, with a configurable fallback codepage for legacy files
  • Renders Arabic, Hebrew, CJK, Devanagari, Thai, Greek and mixed bidi text
  • Full GFM-plus extension set: tables, task lists, footnotes (editable in place), definition lists, abbreviations, mark / highlight, sub / sup

Built it because I work with a lot of markdown day to day and didn't want to fire up a separate app for every small edit. The whole point is keeping it inside DOpus. Bear in mind it's a solo thing that I just extended because a few recent comments here made me think others might get some use out of it.

I'll push updates to the repo as I improve it. There are install and uninstall scripts for the pre-built package, in app updater and more info here:

9 Likes

So useful. I appreciate your work and thanks for sharing!

1 Like

Pleasure! And here is a new release with extra features for you (nice bike btw, see you on the road).

4 Likes
2 Likes
2 Likes

DopusWorX

hero-forum

4 Likes

Nice work!

It would be cool if this was able to preview normal text files as well.

I agree !
It is quite good, but there is much important to it that I don't really understand.
I have just been waiting and seeing what's next !

Well, as we begin to discuss these things, at the risk of asking too much too soon,
a hook or something to render Obsidian md files would be just great.
My special interest is the community Asciimath plugin, but default Obsidian Latex equations would also be a nice pipe dream come true.

I already can do on the fly source code modifications.
This plugin is very good and useful so far.

1 Like

Cheers, glad it's useful!

Good news on the text files: previewing plain-text and source files with syntax highlighting is already
working in my dev build, so that one's coming in an update.

Maths is on my radar too. The honest constraint isn't difficulty, it's weight: a maths renderer means
shipping its stylesheet and fonts with every file, which fights the lightweight, Sumatra-quick feel I want
to protect. So the plan is to load the maths engine only when a document actually has equations, rather than
bloating every open. Obsidian-style $$…$$ LaTeX is the straightforward target; AsciiMath (your interest) is
a different syntax so it needs a bit more plumbing, but it's on the list. Watch this space.

Also glad to see you are using the red theming :smiley:

3 Likes

Before following your install instructions, I checked that the files were at the right location:

Viewers\mdWorX.dll
Viewers\mdWorX_assets\

Then I was trying to make it work by following your instructions:

  1. In DOpus, go to Settings → File Types.
    Ok

  2. Edit (or create) the Markdown file type covering md, markdown, mdown, mdwn, mkd, mkdn.
    Ok: I have created a File Types Groups and added all the file extensions to it.

  3. Open the Events tab.
    Ok: Events tab is located inside the Commands tab.

  4. Select Left double-click, click Edit, and set the command to just Show.
    I choose the Function: Standard Function (Opus or external) and wrote under Commands "Show". And these questions appers: Just "Show"? Where is the link to your PlugIn?

After left-double-click on a md-File the file opens in the standard Windows editor.

Help is welcome.

Not sure if it's this, but it says to create a file type, not a file type group.

There may already be a file type that's overriding the file type group.

Not sure if it's this, but it says to create a file type, not a file type group.

Yes, this is correct. But if I choose New File Type there is no Event tab.

For not so experienced users like me, screenshots would lead to much fewer interpretations.

I think that's a bug on our side. We'll investigate, but if you create the type and then edit it you get the Commands -> Events tab. It's just missing when first creating the type.

1 Like

Thank Leo.

I followed the steps, but the result is the same. The file only opened in the same editor as when I opened it from the Windows Explorer. I also restarted DOPUS, but the same result.

I will automate this via the plugin settings as simple button to click. Thanks for raising it. In the mean time....

It's not the dll, just the viewer.exe should work fine. let me know @ped

Quick fix (and delete the file-type Group you made first, you don’'t need it):

  1. Settings > File Types, select/search MD (Markdown), click Edit. <--- [It will handle the other file type associations automatically]
  2. Commands tab > Actions > select open > Edit.
  3. Type: Run an application. Application: "C:\Program Files\GPSoftware\Directory Opus\d8viewer.exe"
  4. OK out, then double-click a .md file.

Opus passes the filename automatically. That is my own setup (screenshot attached).

2 Likes

Now it works.

Thanks a lot for the help.

1 Like

Apologies for not considering this in the readme earlier. There is a lot to juggle especially with upcoming improvements soon.

1 Like

This is incredibly useful, thank you!

It would be helpful to have a function that removes all formatting or return a line/block or selection to default text. For example, I found a line in a md file that was a different font and size. A simple one-click button could remove all previous formatting, making it easy to reformat it consistently with the rest of the document.

I notice that copying material from Logseq maintains the underlying formatting like headings but changing them (say h1 to h3) seems to keep extra "#" codes. I am not sure what is happening here.

I also have Typora, and can make changes there, but when I used this extension in DOPUS, it seemed much more convenient. You have exceeded my expectations as you have added more functionality. This is so good it should be a standard part of DOPUS.

2 Likes

This is actually going to be covered in a pretty big update, which I hope to release soon, so keep your eye out for it. I will release it as a beta for you guys to test and let me know.

And yes, it is turning out to be exceeding even my expectations from when I first had it. I just keep finding things that I can add to it. Luckily, a lot of this stuff I can port from previous work I've done, so I know the method roughly, then it's just working with the nuances of CodeMirror and co.

I'm just lucky that DOpus has made it actually quite easy to integrate on that side, so it's really a big thanks to them for making this available. I just hope there's lots of envious eyes from people who don't have DOpus and wish they could for things like this, which will hopefully convert into revenue for them.

6 Likes

This post looks pretty fresh, but the GitHub repo says: "mdWorX is deprecated
No longer maintained — superseded by DopusWorX."

However, the mentioned repo doesn't seem to exist for me, I can't find anything about it even after searching. Am I the dumb one here?