henriklovhaug / md-tui

Markdown renderer in the terminal
GNU Affero General Public License v3.0
205 stars 13 forks source link

Split into library and binary #134

Closed erak closed 2 months ago

erak commented 4 months ago

It would be great to be able to use md-tui as a library and build own widgets around it.

This pull request:

henriklovhaug commented 4 months ago

Nice. I'll take a look at it later today

henriklovhaug commented 4 months ago

Seems like the bin folder was not added. Bin is in .gitignore from a while back when I cross built for x86

erak commented 4 months ago

Seems like the bin folder was not added. Bin is in .gitignore from a while back when I cross built for x86

Oh, sorry! Fixed :)

henriklovhaug commented 4 months ago

Isn't it sufficient to create a lib.rs file and do the pub mod there? Why move it outside of src?

orhun commented 2 months ago

Isn't it sufficient to create a lib.rs file and do the pub mod there? Why move it outside of src?

That would work. We only need to change the [[bin]] directive in Cargo.toml I think.

Btw what is the status on this? I really need a markdown renderer widget and md-tui seems like the best one around.

@henriklovhaug would you be down to accept this PR with the suggested changes applied and conflicts resolved? I think I can submit another PR while including these changes since @erak doesn't seem to be around for a while.

LMK!

henriklovhaug commented 2 months ago

I can take a look at it.

orhun commented 2 months ago

I would also like to add feature flags for disabling some of the heavy dependencies (e.g. treesitter ones). Also, I realized some issues with the height calculation. I think I will submit a PR with all of those fixes :)

henriklovhaug commented 2 months ago

By all means submit a PR. I never made this with a library flow in mind. I created it because Glow couldn't follow links, so I see it's not too ergonomic to implement in you own TUI program.