Skip to content

lexicone42/moth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

moth

Render markdown on the CLI, with pizzazz.

A terminal markdown renderer written in Rust, inspired by glow.

Features

  • Syntax-highlighted code blocks with box-drawing borders
  • Colored headings (h1–h6), bold, italic, strikethrough
  • Inline code with background highlighting
  • Box-drawn tables with header separators
  • Blockquotes with vertical bar
  • Ordered and unordered lists with nesting
  • Links, images, horizontal rules
  • Word wrapping to terminal width or custom width
  • Dark and light themes
  • Pager support (less -r or $PAGER)
  • Stdin support for piping

Install

cargo install --path .

Usage

# Render a file
moth README.md

# Pipe from stdin
cat doc.md | moth -

# Custom width
moth -w 60 README.md

# Light theme
moth -s light README.md

# Through a pager
moth -p README.md

Options

Usage: moth [OPTIONS] [FILE]

Arguments:
  [FILE]  Markdown file to render (use "-" for stdin)

Options:
  -w, --width <WIDTH>  Word wrap at specified width (0 = terminal width) [default: 0]
  -p, --pager          Pipe output through a pager
  -s, --style <STYLE>  Style to use (dark, light) [default: dark]
  -h, --help           Print help
  -V, --version        Print version

Acknowledgments

Inspired by glow by Charmbracelet.

License

Licensed under either of

at your option.

About

A terminal markdown renderer written in Rust, inspired by glow

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages