deno-gfm
deno-gfm copied to clipboard
Replace Prism with starry-night
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.
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).
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.
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".
Since YAML parsing is still broken, I would very much appreciate such a toggle
@hashrock opinions on a toggle here?
Hi guys, please take a look at my PR https://github.com/denoland/deno-gfm/pull/96 which solves the yaml issue. (Or at least it tries to -- please let me know if it's not working as expected!)
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?
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/.
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.
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?
yeah +1 for having a config option
If you do add a config option, please include all
vs common
for the Starry Night language selection.