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

[Feature]: Add shiki syntax highlighting plugin support #211

Closed
hustcer opened this issue Oct 19, 2023 · 7 comments
Closed

[Feature]: Add shiki syntax highlighting plugin support #211

hustcer opened this issue Oct 19, 2023 · 7 comments
Assignees
Labels

Comments

@hustcer
Copy link

hustcer commented Oct 19, 2023

What problem does this feature solve?

rspress seems to support PL syntax highlighting by prismjs at the moment, hopefully the Shiki plugin can be added as well. The advantage of supporting shiki is that prism may can't support syntax highlighting for some less common programming languages in the short term, but if it supports the shiki plugin, the corresponding syntax highlighting grammar can be applied to shiki as long as it has a VSCode extension. And the Nushell official site is currently using this solution!

What does the proposed API look like?

Something like this: https://vuepress.github.io/reference/plugin/shiki.html

@hustcer
Copy link
Author

hustcer commented Oct 31, 2023

Hey, any thoughts on this issue?
We may move away from VuePress and use rspress instead someday: nushell/nushell.github.io#1126
And this is the most important thing we care about. Thanks

@hustcer hustcer changed the title [Feature]: 添加 shiki 插件支持 [Feature]: Add shiki syntax highlighting plugin support Oct 31, 2023
@sanyuan0704
Copy link
Collaborator

Thanks for feedback. I think it's important to ensure the flexibility in code highlight solution. Currently the most difficult thing is that rspress does code highlight in runtime instead of compiled-time, in the meanwhile, shiki only supports compiled-time code highlight in most cases. So i'm going to solve the problem and add a @rspress/plugin-shiki to support shiki highlight in rspress.

@hustcer
Copy link
Author

hustcer commented Nov 1, 2023

That’s great, very appreciated !

@sanyuan0704
Copy link
Collaborator

I will support the plugin this week and notify you after finishing it.

@hustcer
Copy link
Author

hustcer commented Nov 1, 2023

Take it easy, no rush at all

@sanyuan0704
Copy link
Collaborator

@hustcer
Copy link
Author

hustcer commented Nov 20, 2023

@sanyuan0704 Great, Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants