
hi, do you have suggestions for markdown previewer?  CLI and work in my local
  env.  it's ubuntu 26.04 Gnome, tmux terminals.



────────────────────────────────────────────────

• For your setup, I’d start with Glow. It’s the nicest “open Markdown in a tmux
  pane and read it” option:

  glow README.md
  glow .

  It has a good pager/TUI and can discover Markdown files in the current Git
  repo. Ubuntu installs are documented via Snap, though I’d generally prefer a
  release binary or your package manager if it has a current build. Glow
  (https://github.com/charmbracelet/glow)

  For a more capable terminal renderer, try mdcat-ng:

  mdless README.md        # interactive viewer
  mdcat README.md         # render to stdout

  It has syntax highlighting, hyperlinks, an interactive reader, and support for
  inline images when your terminal supports an image protocol. In a normal GNOME
  terminal inside tmux, expect text/hyperlinks to work well, but not inline
  images; that requires terminals such as Kitty, Ghostty, or WezTerm. mdcat-ng
  (https://github.com/pawelb0/mdcat-ng)

  If by “preview” you mean “show me roughly what GitHub will render,” use Grip.
  It runs a local web server and opens a browser preview:

  grip README.md

  It’s particularly useful for checking GitHub-flavored Markdown features and
  layout, but it isn’t terminal-native. Grip Ubuntu manpage
  (https://manpages.ubuntu.com/manpages/questing/man1/grip.1.html)

  My practical recommendation:

  - Everyday docs in tmux: glow
  - Fancy technical docs / images, if you switch terminal emulators: mdcat-ng
  - Final GitHub README check: grip

  A tidy tmux pattern is editor left, renderer right:

  tmux split-window -h 'while true; do clear; glow README.md; sleep 2; done'

  Though for live updating, a file watcher such as entr makes that much nicer
  than polling.

─────────────────────────────────────────────────


› which is capable to handle  mermaid chart renderring?


For Mermaid rendered directly in a terminal, **glowm** is the clearest match:

```bash
glowm README.md
```

It renders Mermaid blocks as inline images, but only in image-capable terminals: Kitty, Ghostty, or iTerm2. It needs Chromium installed. [glowm](https://github.com/atani/glowm)

For your current **GNOME Terminal + tmux** setup, it will fall back to showing the Mermaid source, since GNOME Terminal does not provide the necessary image protocol. If Mermaid is important, I’d switch the outer terminal to **Ghostty** (or Kitty) and configure tmux image-escape passthrough; then `glowm` is a very pleasant solution.

If you want to stay with GNOME Terminal, use the official **Mermaid CLI** to generate SVG/PNG, and view it with GNOME’s image viewer/browser:

```bash
mmdc -i diagram.mmd -o diagram.svg
xdg-open diagram.svg
```

It can also transform Markdown containing Mermaid diagrams into Markdown that references generated SVGs. [Mermaid CLI](https://github.com/mermaid-js/mermaid-cli)

So: terminal-native + Mermaid → `glowm` plus Ghostty/Kitty; GNOME Terminal → `mmdc` plus browser/image viewer.

---

I’d use a two-stage, all-local pipeline:

```text
source.md
  └─ mmdc: source.md → preview/source.rendered.md + preview/source-*.svg
       └─ pandoc: source.rendered.md → preview/source.html
```

`mmdc` already supports Markdown input: it replaces Mermaid code fences with image references and writes the SVGs beside its output Markdown. [Mermaid CLI documentation](https://github.com/mermaid-js/mermaid-cli)

For a document at `~/my/md/notes.md`:

```bash
src="$HOME/my/md/notes.md"
preview="$HOME/my/md/preview"
mkdir -p "$preview"

mmdc -i "$src" -o "$preview/notes.rendered.md"

pandoc "$preview/notes.rendered.md" \
  --standalone \
  --resource-path="$preview:$HOME/my/md" \
  --embed-resources \
  -o "$preview/notes.html"

xdg-open "$preview/notes.html"
```

That yields:

```text
~/my/md/preview/
├── notes.rendered.md
├── notes-1.svg
├── notes-2.svg
└── notes.html
```

I recommend SVG rather than PNG: diagrams stay crisp when zooming, and the HTML is portable. `--embed-resources` makes the final HTML self-contained, while keeping the generated SVG files in `preview/` for inspection/reuse.

For repeat use, put this in `~/bin/mdpreview`:

```bash
#!/usr/bin/env bash
set -euo pipefail

src="$(realpath "$1")"
src_dir="$(dirname "$src")"
base="$(basename "${src%.md}")"
preview="${2:-"$src_dir/preview"}"

mkdir -p "$preview"
mmdc -i "$src" -o "$preview/$base.rendered.md"
pandoc "$preview/$base.rendered.md" \
  --standalone \
  --resource-path="$preview:$src_dir" \
  --embed-resources \
  -o "$preview/$base.html"

xdg-open "$preview/$base.html"
```

Then:

```bash
chmod +x ~/bin/mdpreview
mdpreview ~/my/md/notes.md
```

For live rebuilding while editing, add `watchexec` or `entr` afterward; I’d keep the base pipeline above first since it is predictable and produces shareable HTML.
