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

Use prism.js instead of highlight.js to render code samples #180

Open
muuvmuuv opened this issue Sep 18, 2018 · 9 comments
Open

Use prism.js instead of highlight.js to render code samples #180

muuvmuuv opened this issue Sep 18, 2018 · 9 comments

Comments

@muuvmuuv
Copy link
Contributor

This will give us the ability to add plugins like:

@Glavin001
Copy link
Member

Awesome idea! Pull Requests very welcome!

@Glavin001
Copy link
Member

See https://docusaurus.io/docs/en/doc-markdown#using-prism-as-additional-syntax-highlighter for Docusaurus documentation on using Prism. 🎉

@muuvmuuv
Copy link
Contributor Author

Issue: facebook/docusaurus#972

Docusaurus needs more options to allow modification of Remarkable pre/code tags to add Prism.js plugin relevant classes like line-numbers.
It also needs the ability to choose one highlighter instead of usePrism for a specific language.

@Glavin001
Copy link
Member

It also needs the ability to choose one highlighter instead of usePrism for a specific language.

I think you can use usePrism: true to set for all languages.

@muuvmuuv
Copy link
Contributor Author

@Glavin001 Yes, I tried this, but this will fail due to javascript must be included with component and this seems to not work correctly. I hope to get this fixed with the Docusaurus team and hope to get more options here.

@muuvmuuv
Copy link
Contributor Author

@Glavin001 They have merged my request 🎉 I can now take a better look on extending the config

@Glavin001
Copy link
Member

@muuvmuuv Awesome! Let me know if you need a hand with anything. I look forward to a PR, this is exciting 🎉.

@trusktr
Copy link

trusktr commented Aug 16, 2019

Basically, Prism has more features (plugins) that Highlight doesn't have?

@garretwilson
Copy link

Hi, what's the status on this? I'm curious what you decided to go with. I've been using Prism.js for years on many sites, and in general I love it. There's one huge problem for me, though: Prism.js "hijacks" certain common classes such as important and title, so that if the CSS framework you're using happens to use these classes, too, it screws up the syntax highlighting.

I hope I can stay with Prism.js, but this is really biting me. I'm starting to wonder what my options are, which is why I'm curious to know your experience with other syntax highlighters for the web.

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

4 participants