GithubHelp home page GithubHelp logo

Glow syntax highlighter support about slidev HOT 2 OPEN

asm0dey avatar asm0dey commented on May 31, 2024
Glow syntax highlighter support

from slidev.

Comments (2)

antfu avatar antfu commented on May 31, 2024

Good to know, Glow - thanks for introducing it!

First, to your desired features:

Highlight separate tokens (usually words)

You could, Shiki has a very powerful transformer API - for example: https://shiki.style/packages/transformers#transformernotationwordhighlight

Highlight errors

You could do it as well. Probably much more powerful than Glow as far as I see:

While tbh, they both has certain complexity to set up, it would be actually an integration issue about how we could find a easy way to configure and animate with the clicks system etc. But I also see there shouldn't be any blocker preventing you from doing it on the userland today as Slidev exposes the transformer configs: https://sli.dev/custom/highlighters#configure-shiki (just might not be very easy)


About Glow - while at first glance it seems to be a good idea, after digging in - it doesn't seem to be a very solid solution (https://github.com/nuejs/nue/blob/master/packages/glow/src/glow.js) - it's a hard-coded regex-based solution. This provides rather a rough highlighting result, which to me, fall into the similar category as Prism.js. But as it seems to be more lightweight and modern than Prism, I don't mind to actually support it as long as the integration and maintenance do not take too much effort. But as this is still an integration problem, I don't think word and errors highlight would just work especially if you want to have some animations around them or so.

from slidev.

asm0dey avatar asm0dey commented on May 31, 2024

@antfu thanks a lot for the meaningful answer! I have to agree with your points, it seems this feature should be closed/deprioritized and another one, for "more interesting" highlights, should be created. On it.

from slidev.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.