Introduction

What is leaf?

leaf is a terminal-based Markdown previewer that brings a GUI-like experience to your command line. It renders Markdown files with rich formatting, syntax highlighting, LaTeX math, Mermaid diagrams, and more — all without leaving your terminal.

Key Features

  • Rich Markdown rendering — headers, lists, blockquotes, tables with Unicode borders, and syntax highlighting for 40+ languages.
  • LaTeX & Mermaid — math formulas rendered as Unicode, diagrams as ASCII art.
  • Interactive navigation — vim-like keybindings, mouse support, scrollbar, and full-text search.
  • Table of Contents — sidebar TOC with active section tracking.
  • File picker — fuzzy finder (Ctrl+P) and directory browser (Shift+P).
  • Watch mode — auto-reload on file changes, preserving scroll position.
  • Editor integration — open files in your preferred editor with Ctrl+E.
  • 4 themes — Arctic, Forest, Ocean (default), Solarized-Dark.
  • Cross-platform — macOS, Linux, Windows, Android/Termux.

Quick Start

# Install
curl -fsSL https://leaf.rivolink.mg/install.sh | sh

# Preview a file
leaf README.md

# Watch mode
leaf --watch README.md

# Open file picker
leaf

Next Steps

  • Installation — detailed installation guide for all platforms.
  • Usage — learn the basics of using leaf.
  • Features — explore all features in depth.