Repolode
thiagokokada

thiagokokada/gh-gfm-preview

A Go CLI and GitHub CLI extension that starts a local web server to preview GitHub Flavored Markdown, including offline.

Open-source alternative to:GitHub Markdown preview

Stars
133
Forks
4
Open issues
0
Last commit
3 months ago

What is it?

gh-gfm-preview starts a local web server that renders a Markdown file in the browser, aiming to match GitHub's Markdown appearance. Rendering is done locally with yuin/goldmark and its extensions, so most features work without an internet connection.

It can run as a standalone binary or as a GitHub CLI extension (`gh gfm-preview`). It accepts a file path, standard input, or an automatically detected README in the current directory, and supports live reloading when the file changes. Directory listing mode lets you browse and preview multiple Markdown or text files.

The project is a hard fork of gh-markdown-preview, which relies on the GitHub Markdown API and therefore needs network access. Features that depend on GitHub access, such as mentioning users or linking issues, are not supported.

Key features

  • 01Renders GFM with local goldmark extensions, working offline
  • 02Supports Mermaid diagrams, MathJax, alerts and syntax-highlighted code blocks
  • 03Live reloads the browser when the previewed file changes
  • 04Accepts file paths, standard input or an auto-detected README
  • 05Directory listing mode for browsing and previewing multiple files
  • 06Runs as a standalone binary or a GitHub CLI extension

Use cases

  • Previewing README or documentation drafts before pushing to GitHub
  • Previewing Markdown from an editor such as Neovim via a keymap
  • Writing Markdown on machines without reliable internet access

Quick start

  1. 1

    Install as a GitHub CLI extension

    gh extension install thiagokokada/gh-gfm-preview
  2. 2

    Preview a Markdown file in your browser

    gh gfm-preview README.md

Things to know

  • GeoJSON/TopoJSON diagrams and map features need an internet connection, and STL 3D diagrams are not supported.
  • Mentions, issue and pull request references, and other GitHub-dependent features are not available.
  • Rendering is an emulation, so it is close to but not identical to GitHub's output.

Topics

FAQ

What is gh-gfm-preview?
A Go CLI and GitHub CLI extension that starts a local web server to preview GitHub Flavored Markdown, including offline. gh-gfm-preview starts a local web server that renders a Markdown file in the browser, aiming to match GitHub's Markdown appearance. Rendering is done locally with yuin/goldmark and its extensions, so most features work without an internet connection.
Is gh-gfm-preview free to use? What license does it have?
gh-gfm-preview is open source under the MIT license. Check the license terms before using it in commercial products.
Is gh-gfm-preview still maintained?
Updated within 6 months. The last commit to gh-gfm-preview was on Jul 24, 2026.
What can I use gh-gfm-preview for?
Previewing README or documentation drafts before pushing to GitHub Previewing Markdown from an editor such as Neovim via a keymap Writing Markdown on machines without reliable internet access
How do I install gh-gfm-preview?
Install as a GitHub CLI extension: gh extension install thiagokokada/gh-gfm-preview Preview a Markdown file in your browser: gh gfm-preview README.md
Where can I get gh-gfm-preview?
The source code and installation instructions are on GitHub: https://github.com/thiagokokada/gh-gfm-preview

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects