Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add markdown support #2

Closed
LiquidityC opened this issue May 15, 2020 · 4 comments · Fixed by #8
Closed

Add markdown support #2

LiquidityC opened this issue May 15, 2020 · 4 comments · Fixed by #8
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@LiquidityC
Copy link
Member

Helpfiles are currently writte in MD. This makes them look good in github but not so much when viewed in the client.

Using this lib: https://github.com/netvl/md.rs we could perhaps improve the look of the markdown files when shown in the client.

Coloring is out, but the other data should turn out better then what we have at least.

@LiquidityC LiquidityC added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels May 15, 2020
@tarkah
Copy link
Contributor

tarkah commented May 15, 2020

Hey, came across your project here from your help wanted tag. Looks pretty cool!

There is this library https://github.com/Canop/termimad. It uses crossterm, where you look like you're using termion, but the library also supports outputting the formatted text with a set width.

As an aside, crossterm targets Windows as well. I use it in a TUI project that I made. If you want full cross-platform support, you may want to migrate over to it.

@tarkah
Copy link
Contributor

tarkah commented May 15, 2020

Example to print formatted text:

use termimad::*;
let skin = MadSkin::default();
let my_markdown = "#title\n* item 1\n* item 2";
let text = FmtText::from(&skin, &my_markdown, Some(80));
println!("{}", &text);

@LiquidityC
Copy link
Member Author

Yes, I checked that out when I was looking around crates.io earlier. Termimad does a lot of extra rendering that probably won't play nice with my vt102 setup. Particularly the fact that I use scrolling areas and through that split the screen into an input area and an output area. I doubt termimad would respect this configuration.

Thanks for the tip though.

@tarkah
Copy link
Contributor

tarkah commented May 15, 2020

No problem. https://docs.rs/mdcat seems to be another option, though you may face the same limitations outputting to your terminal. Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants