Experimenting with Markdown and MDX using Rust.
- Clone repo.
- Run
cargo run
(orCTRL+SHIFT+B
to find the run task)
This project requires you to have Rust installed in your development environment.
use comrak::{markdown_to_html, ComrakOptions};
use std::fs;
fn main() {
println!("Opening README \n");
let file_path = "README.md".to_string();
let contents = fs::read_to_string(file_path).expect("Couldn't read file");
let markdown = markdown_to_html(&contents, &ComrakOptions::default());
println!("Markdown parsed into HTML \n");
println!("{markdown}");
}