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

Prism syntax highliting #3657

Open
eitsupi opened this issue Oct 11, 2023 · 6 comments
Open

Prism syntax highliting #3657

eitsupi opened this issue Oct 11, 2023 · 6 comments

Comments

@eitsupi
Copy link
Member

eitsupi commented Oct 11, 2023

https://prismjs.com/#supported-languages

Prism is used by Docusaurus, a popular static site generator.

Here is an example of third-party syntax that should be able to support PRQL in the same way.
https://github.com/SassDoc/prism-scss-sassdoc

@eitsupi
Copy link
Member Author

eitsupi commented Oct 12, 2023

Wow, @vanillajonathan already created a PR for this! (PrismJS/prism#3736)
Thanks @vanillajonathan!

@eitsupi
Copy link
Member Author

eitsupi commented Oct 12, 2023

TODO: Enable prql syntax highlighting on ClickHouse documents (https://github.com/ClickHouse/clickhouse-docs/blob/44fb2eefa08e8d6037c91958292ccca40003f294/docusaurus.config.js#L214) once this is available from Docusaurus

@vanillajonathan
Copy link
Collaborator

Prism is working on Prism v2 so they're no longer accepting any contributions to v1. My PR is against the v2 branch, I hope it will get merged. There is a roadmap but no information about when v2 will be released.

PrismJS/prism#3531 (Roadmap for Prism v2)
https://github.com/PrismJS/prism/issues?q=is%3Aissue+milestone%3A2.0 (Milestone for v2)

@eitsupi
Copy link
Member Author

eitsupi commented Oct 12, 2023

I see, thank you for the explanation (I don't remember it at all, but there was evidence that I responded to that discussion).

Maybe it's possible to keep it here or another repo like https://github.com/SassDoc/prism-scss-sassdoc if it's not merged?

@vanillajonathan
Copy link
Collaborator

vanillajonathan commented Oct 12, 2023

Maybe it's possible to keep it here or another repo like https://github.com/SassDoc/prism-scss-sassdoc if it's not merged?

Yes, I suppose so, but my intention and hope is for the PR to be merged upstream so that it will be readily and easily available downstreams without additional setup, configuration or packages.

Note that clickhouse-docs uses Prism v1 and my PR is for Prism v2. We could create a syntax highlight definition for v1, but without it being available upstream it would be more burden on downstream users of Prism to use our syntax highlighting.

@eitsupi
Copy link
Member Author

eitsupi commented Oct 12, 2023

Thanks, it seems that Docusaurus depends on prism vendored version on prism-react-renderer.
https://github.com/FormidableLabs/prism-react-renderer/blob/9c041dfd8580b8b71f55c2a57e61f4c63356d4f4/package.json#L44
https://github.com/FormidableLabs/prism-react-renderer?tab=readme-ov-file#prism

Perhaps it will take a while to reach Docusaurus here after the PRs are merged.

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