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

Replace Prism with starry-night #56

Open
kidonng opened this issue Mar 30, 2023 · 12 comments
Open

Replace Prism with starry-night #56

kidonng opened this issue Mar 30, 2023 · 12 comments

Comments

@kidonng
Copy link
Contributor

kidonng commented Mar 30, 2023

starry-night is a syntax highlighter with feature parity to GitHub, which makes it an interesting alternative to currently used Prism. And styling is free if #55 is accepted.

@lino-levan
Copy link
Contributor

Looks interesting. What are the performance implications? What are the advantages over what we currently have? Given that this is a big breaking change, we should consider doing #55 at the same time (if we choose to do so, as I said there I am a little -1 on it).

@kidonng
Copy link
Contributor Author

kidonng commented Mar 30, 2023

What are the performance implications?

It's by remark author so I would not worry too much about that.

What are the advantages over what we currently have?

  • Short version: it's high-fidelity/quality highlighting
  • Long version: read its readme

Given that this is a big breaking change, we should consider doing #55 at the same time

It's a breaking change for good. And this is intended after #55, or else it would need to import styles from starry-night.

@lino-levan
Copy link
Contributor

We determined in #67 that starry night is too slow for default usage here. We might be able to still use it if we have a toggle between "fast but bad" vs "good but slow".

@kyeotic
Copy link

kyeotic commented Jan 23, 2024

Since YAML parsing is still broken, I would very much appreciate such a toggle

@lino-levan
Copy link
Contributor

@hashrock opinions on a toggle here?

@deer
Copy link
Contributor

deer commented Jan 23, 2024

Hi guys, please take a look at my PR #96 which solves the yaml issue. (Or at least it tries to -- please let me know if it's not working as expected!)

@kyeotic
Copy link

kyeotic commented Jan 24, 2024

I don't want to say I don't care about performance at all, because if the page took 20 seconds to load it would be a dealbreaker. If it takes 2 seconds to load a page with bullerproof syntax highlighting that matches GitHub exactly, though, I'm good with that.

I care way more about accuracy than performance for a blog. Looking at all the YAML blocks with only two colors, and most of them wrong, is aggravating.

I just spent 2 hours trying to move to Starry Night myself, but got so caught up trying to match the the styling that is spread between UnoCSS, gfm, and the syntax css that I gave up. I'll probably take another crack soon, because after seeing what Starry Night can I don't see any point to Prism anymore. Who cares if its faster when it renders the wrong thing?

@lino-levan
Copy link
Contributor

lino-levan commented Jan 24, 2024

I've used Starry Night extensively in Pyro. The performance in real-world code snippets is very tolerable (sub 100 ms for a whole page). The performance on arbitrary code snippets (minified code or 1000+ lines of code) is rather slow. I think for personal blog posts or documentation where the code snippets are known a priori, starry night works great.

You can check out working YAML using starry night at https://pyro.deno.dev/getting-started/configuration/.

@kyeotic
Copy link

kyeotic commented Jan 24, 2024

Yeah, that looks perfect. I'm not yet ready to move to a different platform, but if getting Starry Night working with deno-gfm/deno_blog ends up being too much work I will give Pyro a look.

@lino-levan
Copy link
Contributor

Pyro was just an example use of Starry Night, it's really great for nice looking code snippets. I do not recommend Pyro for blogs just yet. I'm +1 for having a config option for starry night. What are your thoughts hashrock?

@hashrock
Copy link
Contributor

yeah +1 for having a config option

@kyeotic
Copy link

kyeotic commented Jan 24, 2024

If you do add a config option, please include all vs common for the Starry Night language selection.

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

5 participants