Save X threads as clean Markdown
EN PT ID

Panache for X Threads 2026: Format & Lint Grabbed Markdown

August 23, 2026 · 8 min read · Guide

On August 22, 2026, a Rust tool called Panache landed on Hacker News: a language server, formatter, and linter for Markdown, Quarto, and R Markdown, built by jolars with a lossless concrete syntax tree parser. For anyone who captures X threads as Markdown, it is worth a close look — because the biggest hidden problem with a grabbed thread is not the grabbing, it is the mess: posts arrive with inconsistent line widths, mixed list styles, ragged paragraph wrapping, and code blocks that were never formatted. Panache fixes exactly that class of problem, in one CLI.

This guide is the practical version of a simple idea: you already grab X threads as clean Markdown with ThreadGrab; the step most people skip is normalizing that Markdown before they republish it. Panache gives you an installable, scriptable way to do it — format, lint, auto-fix, and even enforce it in CI. The whole loop takes about ten minutes to set up and pays off every time you turn a captured thread into an X Article, a LinkedIn post, or a blog draft.

Quick take: Grabbing an X thread as Markdown gives you a faithful copy, but not a polished one. Panache — a fresh Rust formatter + linter for Markdown (HN August 22, 2026) — normalizes line width, reflows paragraphs, auto-fixes list and spacing issues, and even formats code blocks with external tools. Pair it with ThreadGrab: grab, format, lint, then republish clean. Works as a one-liner, a pre-commit hook, or a CI step.

Why Grabbed Threads Need a Formatter and Linter

A thread capture is a faithful copy of the source, which is exactly what you want for an archive — but it is rarely what you want to publish. When you convert a multi-post thread to Markdown, the output tends to have:

None of this breaks rendering, but all of it makes the Markdown harder to edit and less professional when you republish it. A formatter normalizes the structure; a linter tells you what needs fixing; auto-fix does it for you.

What Panache Does (Verified)

Panache is open source on GitHub (MIT license), written in Rust, and distributed through dozens of channels including cargo install, Homebrew, npm, PyPI via uv tool or pipx, and an official install script. Three capabilities matter for the republishing workflow:

It also ships a full language server (LSP) for editor features — diagnostics, code actions, document outline, and go-to-definition for references — so the same engine works inside VS Code or your editor of choice. The performance page benchmarks it against Prettier, mdformat, markdownlint, and others, and the comparison page shows exactly where it handles Quarto/Pandoc syntax the older tools miss.

Install Panache

Pick the install method that fits your machine. On macOS and Linux the official script is the shortest path:

# Official install script (macOS / Linux)
curl --proto '=https' --tlsv1.2 -sSf https://panache.bz/install | sh

# Or via package managers
cargo install --locked panache
brew install panache
npm install -g @panache-cli/panache
uv tool install panache-cli   # or: pipx install panache-cli

Once installed, confirm it works:

panache --version
panache format --help

Step 1 — Grab the Thread, Then Format It

Convert the public X thread to Markdown with ThreadGrab, then normalize it with panache format. The grab stage gives you a faithful source; the format stage gives you a clean one.

# 1. Grab the public X thread as clean Markdown
threadgrab https://x.com/you/status/1234567890123456789 \
  --output ./drafts/thread-2026-08.md

# 2. Format it in place, reflowing to your line width
panache format ./drafts/thread-2026-08.md

# 3. Or pipe a single file through stdin
cat ./drafts/thread-2026-08.md | panache format

Panache reads its config from .panache.toml in the current or a parent directory, so you can pin the style once and reuse it across every grabbed file. A minimal config that reflows paragraphs to a comfortable line width looks like this:

# .panache.toml
[format]
wrap = "reflow"
line-width = 80
line-ending = "auto"

Step 2 — Lint and Auto-Fix Before You Republish

Before republishing, run the linter to catch anything formatting left behind, and let it auto-fix what it can:

# Report formatting issues across all grabbed threads
panache lint ./drafts/*.md

# Verify a file is already clean (exit code is non-zero if it is not)
panache format --check ./drafts/thread-2026-08.md

# Format + fix a whole directory of captures at once
panache format ./drafts/**/*.md

Because --check returns a meaningful exit code, you can drop it into any script or CI job: if a grabbed thread is not formatted, the job fails and you know exactly which file to fix.

Step 3 — Keep Code Blocks Consistent with External Formatters

Threads that include code or config are where formatting really pays off. Panache runs external formatters on fenced code blocks, so you can keep every code sample consistent with the same tooling you already use. Add a [formatters] section to your config:

[formatters]
python = ["isort", "black"]
javascript = "prettier"
typescript = "prettier"

[formatters.prettier]
prepend-args = ["--print-width=100"]

Now when you format a grabbed thread that contains Python or JavaScript snippets, Panache passes those blocks through isort + black or Prettier automatically. The narrative Markdown is normalized by Panache; the embedded code is normalized by the tool your project already standardizes on.

Step 4 — Enforce It Automatically with Pre-commit or CI

The final step is removing the need to remember. Panache ships a pre-commit hook and a dedicated GitHub Action, so every grabbed Markdown file is formatted and linted before it gets into your repo or your published output.

# .pre-commit-config.yaml
repos:
  - repo: https://github.com/jolars/panache-pre-commit
    rev: v3.4.0
    hooks:
      - id: panache-format
      - id: panache-lint
# GitHub Actions — in your workflow file
- uses: jolars/panache-action@v1

With a pre-commit hook in place, the pipeline becomes fully automatic: grab the thread with ThreadGrab, commit, and Panache formats + lints it before the commit lands. Clean Markdown becomes the default, not the exception.

Panache vs. the Field

The README's comparison page positions Panache against Prettier, mdformat, markdownlint, marksman, and related tools. The short version for thread republishing:

ToolBest atWhere Panache differs
PanacheQuarto/Pandoc/R Markdown, LSP, code-block formattersOne CLI for format + lint + auto-fix + editor
PrettierJavaScript-ish Markdown, code formattingFails on some Quarto fenced divs and table syntax
mdformatSimple Markdown formattingNo LSP, no Quarto/R awareness
markdownlintLinting rulesLinter only; no formatter, no code-block tools

For plain Markdown you can use Panache as a drop-in formatter and linter; for Quarto or R Markdown documents — or when you want an LSP-driven editor experience — it handles cases the older tools simply cannot.

From Grabbed Thread to a Clean, Republishable Source

The quiet payoff of this workflow is repeatability. You end up with a three-stage pipeline anyone can run: grab the thread with ThreadGrab, normalize it with Panache format + lint, and republish it to X Articles, LinkedIn, or a blog from a clean, consistent Markdown source. No more hand-fixing ragged wrapping before every post, and no more wondering whether a captured thread is ready to ship.

Panache is the kind of tool that rewards being early: it is fast, MIT-licensed, actively maintained (pushed within days of the HN launch), and it fits directly where your thread archive already lives. Pair it with the grabbing step and your Markdown library stops being a pile of messy captures and becomes a well-formatted, searchable, republishable archive.

FAQ

What is Panache and what does it do with Markdown?

Panache is a language server, formatter, and linter for Markdown, Quarto, and R Markdown, written in Rust with a lossless concrete syntax tree (CST) parser. It ships a single CLI that can format a file in place, lint it for formatting issues, auto-fix those issues, and run an LSP server for editor integration. It also supports running external formatters and linters (like Prettier, ruff, or black) on the code blocks inside your Markdown documents.

Why would I format and lint the Markdown I grab from an X thread?

A grabbed thread is a faithful copy, not a polished one: posts arrive with inconsistent line widths, mixed list styles, ragged paragraph wrapping, and code blocks that were never formatted. That messy source is painful to edit and republish. Running a formatter normalizes wrapping, reflows paragraphs to a line width you choose, and auto-fixes list and spacing issues, so the Markdown becomes a clean, professional source file you can republish without hand-fixing spacing.

Is Panache an alternative to Prettier or mdformat?

Panache overlaps with those tools but is built around Quarto, Pandoc, and R Markdown syntax, which Prettier and mdformat both fail to handle fully (for example fenced divs and some table syntax). It also adds an LSP language server, an integrated linter with auto-fix, recursive glob formatting, and external code-block formatters. For plain Markdown you can often use it as a drop-in replacement; for Quarto or R Markdown documents it handles syntax the older tools do not.

Can I run Panache on grabbed threads automatically before I republish?

Yes. Panache has a dedicated pre-commit hook and a GitHub Action, so you can format and lint every grabbed Markdown file automatically in CI or before every commit. You can also call it in a one-line shell loop over a directory of grabbed threads, or pipe a single file through stdin with panache format. That makes it easy to keep every captured thread clean without remembering to run it by hand.