Feliz icon indicating copy to clipboard operation
Feliz copied to clipboard

Feliz.Markdown plug-in support

Open dgrimmin opened this issue 1 year ago • 2 comments

Dear Zaid,

For some time now, I have been thinking about how to render math with Feliz.Markdown. I got my inspiration from https://levelup.gitconnected.com/adding-katex-and-markdown-in-react-7b70694004ef . Could you comment on the way to achieve this?

All the best, Dennis

dgrimmin avatar Apr 02 '23 01:04 dgrimmin

Hi @dgrimmin I've looked briefly at the article. I think it is already doable with Feliz.Markdown because you can override how elements are rendered to ReactElement using markdown.components.{<elementRenderer>} where elementRenderer is a function that takes information about the element and let's you choose what ReactElement to render.

Zaid-Ajaj avatar Apr 08 '23 14:04 Zaid-Ajaj

Thank you for your time Zaid.

This reminds me of a part of the source code of your Feliz website, where you have a part named codeBlockRenderer. That is basically the part that needs to be adapted for the rendering is what you are saying if I understand correctly. How would you go about instructing that part of your code to translate the raw text to math react-style? Would it require writing bindings for Katex?

dgrimmin avatar Apr 14 '23 10:04 dgrimmin