16 releases (breaking)
new 0.12.1 | May 23, 2025 |
---|---|
0.11.0 | May 17, 2025 |
0.10.0 | Jan 29, 2025 |
0.5.0 | Dec 30, 2024 |
#668 in Text processing
310 downloads per month
59KB
1.5K
SLoC
mdfried
You can cook a terminal. But can you deep fry a terminal?
YES! You can cook and fry your tty
! Run before it's too late!
The terminal is usually in "cooked" mode, or canonical mode. With
ratatui
🐁, it's in raw mode, but it "cooks" for you.
mdfried
is a markdown viewer for the terminal that renders headers as bigger text than normal.
Screenshots
Video
Why?
Markdown can obviously be rendered pretty well in terminals, but one key aspect is missing: Big Headers™ make text more readable, and rendering images inline is very convenient.
How?
By rendering the headers as images, and using one of several terminal graphics protocols: Sixels, Kitty, or iTerm2. The Kitty terminal also implements a "Text Sizing Protocol" to directly scale text without needing to render as images!
See ratatui-image to see if your terminal does even have graphics support, and for further details.
In general, Kitty, WezTerm, iTerm2, Ghostty, Foot, xterm -ti vt340
, should work.
Usage
Installation
- Rust cargo:
cargo install mdfried
- Nix flake:
github:benjajaja/mdfried
(github:benjajaja/mdfried/v0.11.0
) - Arch Linux:
paru -S mdfried
(AUR) - Windows: Download release
Running
mdfried ./path/to.md
Unless you're using Kitty version 0.40 or greater, or a terminal that does not support any graphics protocol, the first time you run mdfried
you will have to pick a font.
You should pick the same font that your terminal is using, but you could pick any.
The font-setup screen lets you search the system fonts - you will want to pick the same font that your terminal is using.
The font is rendered directly as a preview.
Once confirmed, the choice is written into the configuration file.
Use --setup
to force the font-setup again if the font is not right, or you switch terminals.
Press q
or Ctrl-c
to quit. j
/k
to scroll by lines, Ctrl-d
/Ctrl-u
to scroll by pages. r
reloads
the file (if not using stdin pipe). Mouse scroll also works.
Configuration
~/.config/mdfried/config.toml
is automatically created on first run.
The [skin]
section can be configured to set various colors and styles.
See termimad skin format
for more information.
Dependencies
~38–76MB
~1M SLoC