MARKTerm
Markterm is a library and program to render Markdown to a terminal. It's inspired by Glow and implemented using Markd
Features
- It will syntax highlight code blocks
- It will try to handle light and dark terminal themes. Since it uses the terminal's colors, it should match things like vs code themes in the vs code terminal, etc.
- In general it tries to look good and not gaudy
- It will do the right thing if output is not a tty
- Can be used as a library or as a program
TODO
- ✅ Configurable themes
- ✅ Implement HTML-style links as supported in kitty/alacritty
- ✅ Don't break paragraphs on soft breaks
- ✅ Implement images as supported in kitty (requires timg, kinda buggy)
- ✅ Images in all terminals (requires catimg, kinda useless)
- ✅ Implement HTML block support
- ✅ Better textual image display when images are not supported
- ✅ Maybe only support timg with options
- Use crystal-term/color to detect color capabilities
- Fix whatever bug is there
Usage as a program
Either get a static binary from the releases page or build from source:
- Install crystal
- Checkout the repo
- run
shards build
This is the help:
Markterm - A tool to render markdown to the terminal
Usage:
markterm <file>
markterm -h | --help
markterm --version
Options:
-h --help Show this screen.
--version Show version.
Usage as a library
-
Add the dependency to your
shard.yml
:dependencies: markterm: github: ralsina/markterm
In your code, use it like this:
puts Markd.to_term(source)
Contributing
- Fork it (https://github.com/ralsina/markterm/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Roberto Alsina - creator and maintainer