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]: Automatically analyze code block language to generate highlight configuration #1043

Closed
Timeless0911 opened this issue Apr 29, 2024 · 5 comments

Comments

@Timeless0911
Copy link
Collaborator

What problem does this feature solve?

see details in #419

We can automatically analyze code block language to generate highlight configuration.

What does the proposed API look like?

none

@shulaoda
Copy link
Contributor

I will try to implement this feature.

@shulaoda
Copy link
Contributor

I need some discussion. @Timeless0911
If I use the compile of mdxRs in the loader to obtain the code language used on the page, I can directly import the corresponding highlight method, which is faster but not suitable for disabledMdxRs.
Another way is to scan all the MD files before the compilation of Rspack and extract the code languages, but this means it consumes more performance, which requires providing a parameter called auto on the highlighter for users to choose. Is a certain performance loss necessary for such a feature?

@Timeless0911
Copy link
Collaborator Author

just consider mdxrs scene, it should be option-in and we can specify limitations in doc.

@shulaoda
Copy link
Contributor

just consider mdxrs scene, it should be option-in and we can specify limitations in doc.

How about automatically recognizing highlight languages in mdxRs mode, and the highlighter option only serves as an alias?

@Timeless0911
Copy link
Collaborator Author

just consider mdxrs scene, it should be option-in and we can specify limitations in doc.

How about automatically recognizing highlight languages in mdxRs mode, and the highlighter option only serves as an alias?

LGTM

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

No branches or pull requests

2 participants