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 |
1–9 |
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.