tidied the rest
This commit is contained in:
parent
fef808baf7
commit
c154155c20
1 changed files with 7 additions and 16 deletions
23
src/main.rs
23
src/main.rs
|
|
@ -1,19 +1,10 @@
|
||||||
#![warn(unused_extern_crates)]
|
#![warn(unused_extern_crates)]
|
||||||
use std::{
|
#![allow(clippy::style)]
|
||||||
fs::ReadDir,
|
use std::{path::PathBuf, str::FromStr};
|
||||||
io::{BufWriter, Write, stdout},
|
|
||||||
ops::Deref,
|
|
||||||
path::{self, Path, PathBuf},
|
|
||||||
str::FromStr,
|
|
||||||
};
|
|
||||||
|
|
||||||
use ansi_align::{AlignOptions, ansi_align, ansi_align_with_options};
|
use lipgloss::Border;
|
||||||
use borderrs::BorderFormatter;
|
use mq_markdown::{ColorTheme, ListStyle, RenderOptions, UrlSurroundStyle};
|
||||||
use boxen::boxen;
|
use mq_view::{RenderConfig, render_markdown_with_config};
|
||||||
use lipgloss::{Border, Position};
|
|
||||||
use mq_markdown::{ColorTheme, ListStyle, Markdown, Node, RenderOptions, UrlSurroundStyle};
|
|
||||||
use mq_view::{RenderConfig, render_markdown, render_markdown_with_config};
|
|
||||||
use serde::de::value;
|
|
||||||
use warp::{Filter, filters::path::FullPath};
|
use warp::{Filter, filters::path::FullPath};
|
||||||
|
|
||||||
fn renderer(path: FullPath, user_agent: String) -> Box<dyn warp::Reply> {
|
fn renderer(path: FullPath, user_agent: String) -> Box<dyn warp::Reply> {
|
||||||
|
|
@ -64,7 +55,7 @@ fn renderer(path: FullPath, user_agent: String) -> Box<dyn warp::Reply> {
|
||||||
header_full_width_highlight: false,
|
header_full_width_highlight: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
let styled_mq = mq_view::render_markdown_to_string(&mq).unwrap();
|
let _styled_mq = mq_view::render_markdown_to_string(&mq).unwrap();
|
||||||
|
|
||||||
let mut writer: Vec<u8> = Vec::new();
|
let mut writer: Vec<u8> = Vec::new();
|
||||||
|
|
||||||
|
|
@ -74,7 +65,7 @@ fn renderer(path: FullPath, user_agent: String) -> Box<dyn warp::Reply> {
|
||||||
|
|
||||||
println!("{}", render_string);
|
println!("{}", render_string);
|
||||||
|
|
||||||
let md = mdriver::StreamingParser::new().feed(
|
let _md = mdriver::StreamingParser::new().feed(
|
||||||
termimad::text(std::fs::read_to_string(x).unwrap_or_default().as_str())
|
termimad::text(std::fs::read_to_string(x).unwrap_or_default().as_str())
|
||||||
.to_string()
|
.to_string()
|
||||||
.as_str(),
|
.as_str(),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue