Project

mkd

0.0
No release in over 3 years
Renders Markdown in the terminal using ANSI escape codes and the kitty text sizing protocol for headings.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

 Project Readme

mkd

A terminal Markdown viewer. Renders Markdown with ANSI escape codes and the Kitty graphics/text sizing protocol.

Installation

gem install mkd

Or add to your Gemfile:

bundle add mkd

Usage

mkd README.md

Or pipe from stdin:

cat README.md | mkd

From Ruby:

require 'mkd'
print Mkd.render(markdown_string)

Features

Inline formatting

  • Bold, italic, bold italic, strikethrough, inline code
  • Hyperlinks via OSC 8 terminal sequences
  • :emoji: shortcodes (GitHub-style, powered by gemoji)

Headings

  • H1 and H2 use scaled text via the text sizing protocol (OSC 66) when the terminal supports it, falling back to bold text otherwise
  • Terminal support is auto-detected at runtime by probing cursor position
  • H3 through H6 use bold, underline, and dim ANSI styles

Code blocks

Syntax-highlighted fenced code blocks via Rouge:

puts "hello, world"

Lists

  • Unordered lists with bullet characters
  • Ordered (numbered) lists
  • Nested lists with increasing indentation
  • GFM task lists:
    • unchecked
    • checked

Tables

Rendered with box-drawing characters:

Feature Status
Tables
Alignment

Other

  • Block quotes with vertical bar
  • Horizontal rules
  • Images displayed inline via the Kitty graphics protocol (PNG, SVG)
  • Clickable image links

Screenshot

Screenshot

Requirements

  • A terminal with ANSI escape code support
  • Kitty (or compatible terminal, like Echoes) for image display and scaled headings (auto-detected; works without these in degraded mode)

License

The gem is available as open source under the terms of the MIT License.