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

Change code highlight module to Shiki #9834

Closed
2 tasks done
SuperManito opened this issue Feb 8, 2024 · 1 comment
Closed
2 tasks done

Change code highlight module to Shiki #9834

SuperManito opened this issue Feb 8, 2024 · 1 comment
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.

Comments

@SuperManito
Copy link

SuperManito commented Feb 8, 2024

Have you read the Contributing Guidelines on issues?

Description

Prism performance is not good enough

Has this been requested on Canny?

No response

Motivation

Shiki is a syntax highlighter based on Microsoft VSCode TextMate grammar. TextMate grammar is very powerful.

API design

No response

Have you tried building it?

No response

Self-service

  • I'd be willing to contribute this feature to Docusaurus myself.
@SuperManito SuperManito added feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. status: needs triage This issue has not been triaged by maintainers labels Feb 8, 2024
@SuperManito SuperManito changed the title Change code highlight module to [Shiki](https://shiki.style) Change code highlight module to Shiki Feb 8, 2024
@slorber slorber removed the status: needs triage This issue has not been triaged by maintainers label Feb 8, 2024
@slorber
Copy link
Collaborator

slorber commented Feb 8, 2024

Duplicate of #9122

It doesn't have to live in the Docusaurus repo and can remain a third-party plugin

See also:


Note: afaik TextMate grammars are heavy, and Shiki should rather be used at build time instead of runtime. For that, highlighting through a remark plugin is a good option.

In the future we might have support for React Server Components (#9089) to keep Shiki out of the bundle (related, also based on TextMate grammars: https://bright.codehike.org/).

@slorber slorber closed this as not planned Won't fix, can't repro, duplicate, stale Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Projects
None yet
Development

No branches or pull requests

2 participants