You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by David Jencks <da...@gmail.com> on 2021/11/09 01:14:45 UTC
[website] Code highlighting
(prompted by seeing a recent highlight.js upgrade in the website)
Someone pointed out shiki (https://shiki.matsu.io) on the Antora zulip recently and I wrote an Antora extension to set it up and use it as the (build time) syntax highlighter in Asciidoctor.
The main point is that the syntax highlighting is grammar based, using the same parsers as VSCode.
There isn’t all that much code to be highlighted in the docs, but I’ll make a demo to compare. Perhaps using it would be a good idea.
My project is antora-shiki <https://gitlab.com/djencks/antora-shiki>.
David Jencks
Re: [website] Code highlighting
Posted by Zoran Regvart <zo...@regvart.com>.
Hi David,
On Tue, Nov 9, 2021 at 2:38 PM David Jencks <da...@gmail.com> wrote:
>
>
>
> > On Nov 9, 2021, at 12:02 AM, Zoran Regvart <zo...@regvart.com> wrote:
> >
> > Hi David,
> >
> > On Tue, Nov 9, 2021 at 2:14 AM David Jencks <da...@gmail.com> wrote:
> >>
> >> (prompted by seeing a recent highlight.js upgrade in the website)
> >>
> >> Someone pointed out shiki (https://shiki.matsu.io) on the Antora zulip recently and I wrote an Antora extension to set it up and use it as the (build time) syntax highlighter in Asciidoctor.
> >>
> >> The main point is that the syntax highlighting is grammar based, using the same parsers as VSCode.
> >>
> >> There isn’t all that much code to be highlighted in the docs, but I’ll make a demo to compare. Perhaps using it would be a good idea.
> >>
> >> My project is antora-shiki <https://gitlab.com/djencks/antora-shiki>.
> >
> > That looks interesting, I would like to trimm down on JavaScript usage
> > where appropriate. Though the Hugo bits also use highlight.js, so some
> > blog posts take advantage of this. I'd like to see a syntax
> > highlighter that doesn't use inline CSS also, does Shiki have this
> > option?
>
> It looks like themes.md <https://github.com/shikijs/shiki/blob/main/docs/themes.md#theming-with-css-variables> css variables for color names is as far as it goes right now, but the docs seem to indicate that it’s pretty easy to write a new theme. I’m not sure we’d want to get into that, but perhaps contributing it to shiki would be an option.
I've noticed that Prism[1] uses class names instead of inline styling,
but let's not bikeshead this too much, if you think going with shiki
would be better, and more importantly have enough enthusiasm to pursue
this, go right ahead :)
zoran
[1] https://prismjs.com/
--
Zoran Regvart
Re: [website] Code highlighting
Posted by David Jencks <da...@gmail.com>.
> On Nov 9, 2021, at 12:02 AM, Zoran Regvart <zo...@regvart.com> wrote:
>
> Hi David,
>
> On Tue, Nov 9, 2021 at 2:14 AM David Jencks <da...@gmail.com> wrote:
>>
>> (prompted by seeing a recent highlight.js upgrade in the website)
>>
>> Someone pointed out shiki (https://shiki.matsu.io) on the Antora zulip recently and I wrote an Antora extension to set it up and use it as the (build time) syntax highlighter in Asciidoctor.
>>
>> The main point is that the syntax highlighting is grammar based, using the same parsers as VSCode.
>>
>> There isn’t all that much code to be highlighted in the docs, but I’ll make a demo to compare. Perhaps using it would be a good idea.
>>
>> My project is antora-shiki <https://gitlab.com/djencks/antora-shiki>.
>
> That looks interesting, I would like to trimm down on JavaScript usage
> where appropriate. Though the Hugo bits also use highlight.js, so some
> blog posts take advantage of this. I'd like to see a syntax
> highlighter that doesn't use inline CSS also, does Shiki have this
> option?
It looks like themes.md <https://github.com/shikijs/shiki/blob/main/docs/themes.md#theming-with-css-variables> css variables for color names is as far as it goes right now, but the docs seem to indicate that it’s pretty easy to write a new theme. I’m not sure we’d want to get into that, but perhaps contributing it to shiki would be an option.
David Jencks
Re: [website] Code highlighting
Posted by Zoran Regvart <zo...@regvart.com>.
Hi David,
On Tue, Nov 9, 2021 at 2:14 AM David Jencks <da...@gmail.com> wrote:
>
> (prompted by seeing a recent highlight.js upgrade in the website)
>
> Someone pointed out shiki (https://shiki.matsu.io) on the Antora zulip recently and I wrote an Antora extension to set it up and use it as the (build time) syntax highlighter in Asciidoctor.
>
> The main point is that the syntax highlighting is grammar based, using the same parsers as VSCode.
>
> There isn’t all that much code to be highlighted in the docs, but I’ll make a demo to compare. Perhaps using it would be a good idea.
>
> My project is antora-shiki <https://gitlab.com/djencks/antora-shiki>.
That looks interesting, I would like to trimm down on JavaScript usage
where appropriate. Though the Hugo bits also use highlight.js, so some
blog posts take advantage of this. I'd like to see a syntax
highlighter that doesn't use inline CSS also, does Shiki have this
option?
zoran
--
Zoran Regvart