Canop / termimad

A library to display rich (Markdown) snippets and texts in a rust terminal application
MIT License
903 stars 31 forks source link

Pass InputField into a MadSkin #33

Closed ahmedsaheed closed 2 years ago

ahmedsaheed commented 2 years ago

GIven an input field

 Input: InputField::default(),

How do i get the input rendered as MD with a skin like so ?

skin.write_in_area_on(w, Input, &self.area);

I am just trying to render MD directly from the input

Canop commented 2 years ago

You mean you want to render in another area the text the user typed in the input ?

ahmedsaheed commented 2 years ago

Exactly, what i am trying to do is render the user input as markdown on a seperate area. It's kind of tricky for me to achieve.

Canop commented 2 years ago

Ok. There should be no problem but it's easier when you wrote the crate. I'll try to build an example tomorrow.

ahmedsaheed commented 2 years ago

okay, thanks a million

Canop commented 2 years ago

I've added this example: https://github.com/Canop/termimad/tree/master/examples/render-input-markdown

If you have more questions, you might also ask in the chat room: https://miaou.dystroy.org/3768