mdcat icon indicating copy to clipboard operation
mdcat copied to clipboard

[don't merge] ratatui widget

Open lengyijun opened this issue 1 year ago • 8 comments

Make mdcat work in ratatui

Hacks every writeln, collect every line in a vector, and then write to screen one by one

cargo run --example fast
cargo run --example slow

lengyijun avatar Jan 22 '24 13:01 lengyijun

I'm sorry but what's this for? What is ratatui and what does this pull request intend to achieve?

swsnr avatar Jan 22 '24 14:01 swsnr

ratatui is https://github.com/ratatui-org/ratatui

lengyijun avatar Jan 22 '24 14:01 lengyijun

Would you like to extend mdcat to support ratatui ? If not, I think I should notify and credit you before publishing in ratatui community

lengyijun avatar Jan 22 '24 14:01 lengyijun

Well, I'm sorry, mean no offence, but… you're asking me to review and merge a diff which adds about 1800 lines to support something I don't even know about, and all you can say about it is five lines of text and a link?

I'm sorry but that won't do. Please do provide a comprehensive summary of

  • what ratatui is precisely,
  • why mdcat needs to have special code to support it,
  • why it needs to have such an excessive lot of additional code to support it, and
  • why this has to be in mdcat itself, instead of a separate library.

And regardless of these questions, this pull request is way too big for me to review. For me to take a look at it (provided that I do agree we should have this in mdcat) you'd have to split this up, at least into multiple smaller, self contained commits with comprehensive commit messages, or probably even into multiple pull requests.

And you'd definitely have to get rid of the git dependency to your personal repo.

swsnr avatar Jan 22 '24 18:01 swsnr

AFAIK, no available ratatui widget support markdown, as listed in https://github.com/ratatui-org/awesome-ratatui

Port mdcat to ratatui is the relatively promissing and painless solution

lengyijun avatar Jan 23 '24 01:01 lengyijun

This "painless" pull request adds about a thousand extra lines to mdcat, and I still don't understand why it's needed.

How does mdcat benefit from this pull request? Why can't this "ratatui support" be a separate library?

swsnr avatar Jan 23 '24 05:01 swsnr

Why can't this "ratatui support" be a separate library?

That's fine, but it's nicer if you are willing to maintain an official port

This pr is far from perfect and not ready to merge, but maybe a humble reference

lengyijun avatar Jan 23 '24 10:01 lengyijun

I still don't understand how this would benefit mdcat?

swsnr avatar Jan 23 '24 14:01 swsnr

I'm closing this merge request, as I still don't see the benefit for mdcat.

swsnr avatar Jan 27 '24 09:01 swsnr