You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I must have to re-init carta = new Carta({theme: currentTheme});
Second thing, live streaming of markdown is not supported directly only for Mardown viewer. I tried to copy internal Renderer component, it works but then especially with code and tikz there are limitations. It will throw errors like "javascript language not found, please load it first". May be this is due to smallest debounce time I set. but debounce time is still not valid solution, if library is trying to load language file from server as needed. what if request takes lot of time? Also debounce time makes streaming flow slower.
So i need to load all bundled languages at once, which is also not good practice, as why I load python when I actually do not need it.
Note that I cannot render html from server side. Server already returns markdown as EventStream. Think like I want to make chat bot.
Ultimately either there is no better way for such use case in this lib OR I am not getting right way from docs. I would appreciate if developers of this lib can throw some light and give me little help.
Thanks,
Jay
The text was updated successfully, but these errors were encountered:
What theme are you trying to change at runtime? Is it the one used to highlight Markdown in the code editor or the one for the output HTML with plugin-code? In the first case, your example should work (as long as the theme is loaded), while in the other, I was not expecting people to change theme for the rendered HTML. If you still experience issues, open a new issue dedicated to that.
The <Markdown> component is not reactive by design. If you want to make it reactive, you should use the Svelte #key block:
{#keyvalue}
<Markdown {value} {carta} />
{/key}
Rendering Markdown can be pretty resources expensive, so keep that in mind.
Initially I loved this library, seeing seamless integration of plugins.
But as i went to use it for advanced use cases, I felt disappointed.
First thing, I cannot change theme of code highlighter without re-initializing carta. So even following does not work:
I must have to re-init
carta = new Carta({theme: currentTheme})
;Second thing, live streaming of markdown is not supported directly only for Mardown viewer. I tried to copy internal Renderer component, it works but then especially with code and tikz there are limitations. It will throw errors like "javascript language not found, please load it first". May be this is due to smallest debounce time I set. but debounce time is still not valid solution, if library is trying to load language file from server as needed. what if request takes lot of time? Also debounce time makes streaming flow slower.
So i need to load all bundled languages at once, which is also not good practice, as why I load python when I actually do not need it.
Note that I cannot render html from server side. Server already returns markdown as EventStream. Think like I want to make chat bot.
Ultimately either there is no better way for such use case in this lib OR I am not getting right way from docs. I would appreciate if developers of this lib can throw some light and give me little help.
Thanks,
Jay
The text was updated successfully, but these errors were encountered: