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

Syntax highlight and LaTeX at build time #1913

Closed
toastal opened this issue Oct 22, 2022 · 2 comments
Closed

Syntax highlight and LaTeX at build time #1913

toastal opened this issue Oct 22, 2022 · 2 comments

Comments

@toastal
Copy link

toastal commented Oct 22, 2022

It's absolutely wasteful to use highlight.js in it's current incantation.

  1. users with JavaScript disabled for security/privacy don't get syntax highlighting or rendered LaTeX (or using a TUI/minimal browser because of system requirements)
  2. user data plans and network lag are introduced to get the required tools
  3. CPU time and battery are expended to do all this parsing and repainting
  4. All of these phases slow down the render performance

Why should all users be executing the exact same parsers that produce the same markup at runtime when this should be done statically at build time so nobody has to worry about security, their data plans, or their battery life.

@ehuss
Copy link
Contributor

ehuss commented Oct 22, 2022

Yea, ideally the highlighting would be processed at build time. That is being investigated at #1652 (somewhat tracked in #1622, and other issues).

As for LaTeX rendering, I suggest looking at mdbook-katex which I believe does build-time rendering.

I'm going to close as there are other issues tracking build-time support.

@ehuss ehuss closed this as completed Oct 22, 2022
@toastal
Copy link
Author

toastal commented Oct 23, 2022

Awesome. None of these are worded in a way that's discussing the upside of build-time support, so I'm happy you quickly identified it as such.

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