Important
adcat is a fork of mdcat that adds first-class AsciiDoc rendering while keeping the original Markdown support intact. The upstream mdcat project is no longer maintained.
A cat for AsciiDoc that also speaks Markdown.
mdcat already rendered CommonMark beautifully in the terminal. adcat is a fork that teaches it AsciiDoc — .adoc and .asciidoc files render with the same fidelity (formatting, code highlighting, inline images, hyperlinks) as Markdown, using acdc-parser for AsciiDoc and pulldown-cmark for Markdown. Markdown support is preserved verbatim from upstream; nothing was traded away.
$ adcat README.adoc # primary use case: AsciiDoc
$ adcat sample.md # still works exactly like mdcat
adcat in WezTerm, with "One Light (base16)", "Gruvbox Light", and "Darcula (base16)" (from left to right), and JetBrains Mono as font.
- AsciiDoc rendering. Files ending in
.adocor.asciidocare parsed with acdc-parser and rendered to the terminal with the same pipeline as Markdown — sections, lists, tables, code blocks, admonitions, inline macros, images. - AsciiDoc preprocessing. File-backed
.adocdocuments go through the parser's preprocessor, soinclude::directives and conditional blocks (ifdef,ifndef,ifeval) work as expected. - Table fidelity for AsciiDoc. Header/footer rows and cell column spans round-trip through an internal marker convention shared with the bundled renderer.
- Markdown unchanged. All CommonMark features that worked in
mdcatstill work inadcat. If you pointadcatat a.mdfile, you get the same output you'd get from upstreammdcat.
adcat works best with iTerm2, WezTerm, and kitty, and a good terminal font with italic characters. It
- renders AsciiDoc (
.adoc,.asciidoc) with sections, lists, tables, callouts, admonitions, and inline macros, - renders all basic CommonMark Markdown syntax,
- highlights code blocks with syntect,
- shows links and inline images in supported terminals (see above, where "Rust" is a clickable link),
- adds jump marks for headings in iTerm2 (jump with ⇧⌘↓ / ⇧⌘↑).
| Terminal | Basic syntax | Syntax highlighting | Images | Jump marks |
|---|---|---|---|---|
| Basic ANSI¹ | ✓ | ✓ | ||
| Windows 10 console | ✓ | ✓ | ||
| Terminology | ✓ | ✓ | ✓ | |
| iTerm2 | ✓ | ✓ | ✓² | ✓ |
| kitty | ✓ | ✓ | ✓² | |
| WezTerm | ✓ | ✓ | ✓² | |
| VSCode | ✓ | ✓ | ✓² | |
| Ghostty | ✓ | ✓ | ✓² |
- adcat requires that the terminal supports strikethrough formatting and inline links. This includes most modern terminal emulators (Windows Terminal, KDE Konsole, anything based on VTE). It likely won't work well on old terminals that lack these features (e.g. the Linux text console).
- SVG images are rendered with resvg, see SVG support.
Not supported:
- CommonMark extension for footnotes.
- Inline markup and text wrapping in table cells (Markdown or AsciiDoc).
- Some advanced AsciiDoc processor semantics are still rendered approximately.
- Standard-input AsciiDoc cannot resolve relative
include::directives (no source path to anchor against).
Try adcat --help or read the adcat(1) manpage.
adcat selects the renderer by file extension: .adoc / .asciidoc go through the AsciiDoc pipeline, everything else (including - for stdin) is treated as Markdown.
- Release binaries built on GitHub Actions. Provenance attestations at https://github.com/kriipke/adcat/attestations.
- You can also build
adcatmanually withcargo install --path .(see below).
adcat can be linked or copied to adless; if invoked as adless it automatically uses pagination.
Run cargo build --release.
Building requires libcurl.
When packaging adcat you may wish to include the following additional artifacts:
-
A symlink or hardlink from
adlesstoadcat(see above). -
Shell completions for relevant shells, by invoking
adcat --completionsafter building, e.g.$ adcat --completions fish > /usr/share/fish/vendor_completions.d/adcat.fish $ adcat --completions bash > /usr/share/bash-completion/completions/adcat $ adcat --completions zsh > /usr/share/zsh/site-functions/_adcat # Same for adless if you include it $ adless --completions fish > /usr/share/fish/vendor_completions.d/adless.fish $ adless --completions bash > /usr/share/bash-completion/completions/adless $ adless --completions zsh > /usr/share/zsh/site-functions/_adless
-
A build of the man page
adcat.1.adoc, using AsciiDoctor:$ asciidoctor -b manpage -a reproducible -o /usr/share/man/man1/adcat.1 adcat.1.adoc $ gzip /usr/share/man/man1/adcat.1 # If you include adless as above, you may also want to support man adless $ ln -s adcat.1.gz /usr/share/man/man1/adless.1.gz
adcat can output extensive tracing information when asked to. Run adcat with $ADCAT_LOG=trace for complete tracing, or $ADCAT_LOG=adcat::render=trace to trace only rendering.
Copyright Sebastian Wiesner sebastian@swsnr.de and contributors (upstream mdcat); AsciiDoc additions copyright the adcat contributors.
Binaries are subject to the terms of the Mozilla Public License, v. 2.0, see LICENSE.
Most of the source is subject to the terms of the Mozilla Public License, v. 2.0, see LICENSE, unless otherwise noted; some files are subject to the terms of the Apache 2.0 license, see http://www.apache.org/licenses/LICENSE-2.0.
