Crates.io | markterm |
lib.rs | markterm |
version | 0.3.0 |
source | src |
created_at | 2024-06-24 16:57:15.511665 |
updated_at | 2024-07-01 15:51:03.753239 |
description | A rust library to render colored markdown to the terminal. |
homepage | |
repository | https://github.com/avi1989/markterm-rs |
max_upload_size | |
id | 1282370 |
size | 67,647 |
Markterm is a rust library to render colored markdown into the terminal. I wanted something like Glow but as a rust library.
I built this for 2 reasons:
Markterm is currently in development. I will be working over the next few weeks to make sure that it supports CommonMark and Github Flavored Markdown.
MarkTerm currently does not support the following
Add it to any existing rust project using cargo. You can then render any markdown to stdout using the code below.
use std::path::PathBuf;
fn main() {
let path = PathBuf::from("./test.md");
markterm::render_file_to_stdout(&path, None);
}
use std::path::PathBuf;
use markterm::{TextStyle, Theme, ElementStyle};
fn main() {
let path = std::path::PathBuf;
let theme = Theme {
header_1: ElementTheme::new(Some("#000"), Some("#500"), TextStyle::Bold),
.. markterm::get_default_theme()
};
markterm::render_file_to_stdout(&path, Some(&theme));
}
This project would not be possible without markdown-rs. Their ast parsing module powers the library.