Project

marvi

0.0
The project is in a healthy, maintained state
Renders Markdown with ANSI colors in pipes and an interactive curses pager in TTY.
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

Marvi

Marvi is a terminal Markdown renderer. It parses Markdown and displays it with ANSI colors and styles directly in your terminal.

Installation

gem install marvi

Or add to your Gemfile:

bundle add marvi

Usage

CLI

Render a Markdown file:

marvi README.md

Open multiple files at once — each file gets its own tab in a bar at the top of the screen (the bar wraps to multiple rows when tabs don't fit the terminal width):

marvi README.md CHANGELOG.md docs/guide.md

Tab keys inside the pager:

Key Action
Tab / Shift-Tab next / previous tab
19 jump to tab by number
mouse click on a tab switch to that tab
o open a file in a new tab via the file picker
x close the current tab (closing the last one quits)

The o picker lists Markdown/text documents under the current directory and narrows the list as you type (every space-separated term must match, case-insensitive). Move the selection with C-n/C-p (or the arrow keys) and press Enter to open. Start the input with /, ~, ./, or ../ to enter an explicit path instead — Tab then completes it shell-style, and selecting a directory descends into it.

Read from stdin:

cat README.md | marvi
echo "# Hello **world**" | marvi

Ruby API

require "marvi"

markdown = File.read("README.md")
puts Marvi::Renderer.new.render(markdown)

Supported Markdown elements

  • Headings (#, ##, ###, ...)
  • Bold (**text**) and italic (*text*)
  • Inline code (`code`)
  • Code blocks (```)
  • Unordered and ordered lists
  • Blockquotes (> text)
  • Horizontal rules (---)

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt.

bin/setup
rake test
bin/console

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/takkanm/marvi.

License

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