Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

katex JS sent for every page #104

Open
gabevenberg opened this issue Jun 23, 2023 · 2 comments
Open

katex JS sent for every page #104

gabevenberg opened this issue Jun 23, 2023 · 2 comments

Comments

@gabevenberg
Copy link

Currently, the JS for katex is included in every page, regardless of the page using katex or not. This increases the size of the sent javascript considerably. (~200kb, or most of the example site). If its not possible to only conditionally insert katex, would it be possible to render it serverside? (as katex does support that)

@lukeorth
Copy link
Owner

Thank you, @gabevenberg -- this is a great suggestion. The unconditional inclusion of KaTeX JS is something that has always bothered me.

The other JS features (like Mermaid) are conditional, but those use shortcodes. I tried to be clever with KaTeX and delimit using dollar signs $ ... $, but that probably wasn't the best choice. I may need to switch it to use a shortcode too.

Rendering it serverside might be a good route too. I just need to look into it some more.

I'll leave this issue open until we can figure something out. 🙂

@gabevenberg
Copy link
Author

gabevenberg commented Jun 27, 2023

honestly, shortcodes would be a perfectly acceptable solution for my usecase, but of course they would break existing sites using KaTeX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants