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

Remove unnecessary parts of syntax css #67

Closed
Jieiku opened this issue Jun 8, 2022 · 1 comment
Closed

Remove unnecessary parts of syntax css #67

Jieiku opened this issue Jun 8, 2022 · 1 comment

Comments

@Jieiku
Copy link
Owner

Jieiku commented Jun 8, 2022

Remove unnecessary parts of syntax css

Unfortunately the css generated by syntect includes even css related to Sublime GUI features that will never even be used in the web page, this leads to bloat of the syntax css files.

There is a Lot of bloat that could be removed from these files, but it will be very time consuming to clean these files up, care must be taken to not remove useful things from these css files.

The other issue is that I really don't care for the way the class definitions work... I would rather be able to define a pallet of colors .z-1, .z-2, .z-3, etc... with a couple modifiers for bold, italic, and underline: .z-b, .z-i, .z-u Then have a crate that does the work of figuring out how to style the element.

For example, take this line taken from this page: https://abridge.netlify.app/overview-code-blocks/

const e = document.querySelector("main");

Instead of this:

<span class="z-meta z-var z-expr z-ts"><span class="z-storage z-type z-ts">const</span> <span class="z-meta z-var-single-variable z-expr z-ts"><span class="z-meta z-definition z-variable z-ts"><span class="z-variable z-other z-constant z-ts">e</span></span> </span><span class="z-keyword z-operator z-assignment z-ts">=</span> <span class="z-meta z-function-call z-ts"><span class="z-support z-variable z-dom z-ts">document</span><span class="z-punctuation z-accessor z-ts">.</span><span class="z-support z-function z-dom z-ts">querySelector</span></span><span class="z-meta z-brace z-round z-ts">(</span><span class="z-string z-quoted z-double z-ts"><span class="z-punctuation z-definition z-string z-begin z-ts">&quot;</span>main<span class="z-punctuation z-definition z-string z-end z-ts">&quot;</span></span><span class="z-meta z-brace z-round z-ts">)</span></span><span class="z-punctuation z-terminator z-statement z-ts">;</span>

Have something like this:

<span class="z-1">const</span> <span class="z-2">e</span> <span class="z-3">=</span> document<span class="z-8">.querySelector</span>(<span class="z-7">"main"</span>);

Before creating a new rust crate to do this, research would need to be done to make sure that a rust crate does not already exist capable of doing this.

Currently tree-sitter is being considered to replace syntect getzola/zola#1787, but I am unsure if it also generates a crazy long list of class definitions, I need to research this.

The interesting thing is that when you use the .tmTheme file directly zola already outputs pretty tidy html with direct font tags, if it could do something similar with class definitions then it would be in my opinion perfect. I have not looked at any of the code yet that does this work.

@Jieiku Jieiku self-assigned this Aug 31, 2022
@Jieiku
Copy link
Owner Author

Jieiku commented Aug 31, 2022

Going to Close this for now, Keats is hard at work on evaluating and implementing a replacement for Syntect. This likely won't be an issue once his work is merged into Zola.

@Jieiku Jieiku closed this as completed Aug 31, 2022
@Jieiku Jieiku removed their assignment Jun 27, 2024
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

1 participant