GitXplorerGitXplorer
r

markterm

public
7 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
7997c7c5080fd8a8e09a03d6d0342d6c717cf3fe

build: updated dependencies

rralsina committed 3 months ago
Unverified
fb2d77813de9f9fc779464122dc3cddb3238655d

bump: Release v0.5.1

rralsina committed 4 months ago
Unverified
8f7abbef67049c7e0b4b30bec589e4b2bdf6a0b1

fix: support - as filename to read stdin

rralsina committed 4 months ago
Unverified
891e194f19414064e71fc5a01be4802069e5f6e5

chore(ignore): added TODO

rralsina committed 4 months ago
Unverified
e672a70e2edae601dcf6f1bd65b2dd079d9b19f9

chore(ignore): tweak cliff config

rralsina committed 5 months ago
Unverified
427bf296e89ca19cef7dd61f0da9fc6201e7fd8a

chore: todo management

rralsina committed 5 months ago

README

The README file for this repository.

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

markterm on a light terminal markterm on a dark terminal

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
  • ✅ Support being used in a pipeline
  • Implement internal piping to $PAGER
  • Allow enabling/disabling images/html-style-links via CLI (partly done)
  • 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> [-t <theme>][--code-theme <code-theme>][-l]
  markterm -h | --help
  markterm --version

Options:
  -h --help                  Show this screen.
  -t <theme>                 Theme to use for coloring output
  --code-theme <code-theme>  Theme to use for coloring code blocks
  --version                  Show version.
  -l                         Force html-like links

If you use "-" as the file argument, markterm will read from stdin.

Usage as a library

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

  1. Fork it (https://github.com/ralsina/markterm/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors