Jwrede / Anki-KaTeX-Markdown

Creates a new Basic and a new Cloze Note Type that support Markdown and KaTeX
74 stars 5 forks source link

Is it possible to live preview while editing? #8

Closed ficapy closed 3 years ago

ficapy commented 3 years ago

Very wonderful markdown plugin, please ask if there is a way to implement the left edit, the right side of the live display rendering results, this is more interactive!

Jwrede commented 3 years ago

As far as I know it's only possible to use Javascript when the card itself is rendering, while typing there probably is no way to render markdown in an extra field, maybe there is a way to implement it but I'd probably have to reverse engineer the source code for that. For now if you didn't know there is a Cards... button on the left upper side while adding a new card where you can see how your card will be rendered, I hope that helps

ficapy commented 3 years ago

https://github.com/ssricardo/anki-plugins/blob/master/anki-markdown/README.md I found this markdown plugin with a preview function, I'll see how it is implemented first

Here is the details of the implementation https://github.com/ssricardo/anki-plugins/commit/363f82ae763ae2fb5a842d695f26ae35fcd0dcf5#diff-d441c41c06e844d301362710fd2f22f2eb51016e43f86fada8c382e8f55d236f

Jwrede commented 3 years ago

Just rendering it in a text field below would probably be possible, I'll see what i can do later this day, thanks for the suggestion!

Jwrede commented 3 years ago

Okay I think I might have found a way to implement this, this'll probably take me a little bit of time but I'll keep you updated

Jwrede commented 3 years ago

This is my current progress, tell me if you got any ideas on how to improve it, it'll probably take a few days until I'm ready because I'll be busy for a few days

ficapy commented 3 years ago

I think this is great and has basically implemented the live preview requirement. You could release a new version and wait for feedback from other users. Thanks for your work again.

Jwrede commented 3 years ago

Yea I'll release it soon, just making sure there are no bugs that could affect the other parts of the add-on

Jwrede commented 3 years ago

Previewer is online, please tell me if it works

ficapy commented 3 years ago

Previewer is online, please tell me if it works

Yeah, It works great~~