vuejs / vuepress

📝 Minimalistic Vue-powered static site generator
https://vuepress.vuejs.org
MIT License
22.49k stars 4.77k forks source link

Use markdown-it-prism instead of prismjs for code-highlighting #1860

Open DhruvDh opened 5 years ago

DhruvDh commented 5 years ago

Feature request

Vuepress uses prismjs for code highlighting.

To get something I want working I need to use a PrismJS plugin. The way vuepress is set up for code highlighting currently means that there is no way that is obvious for me to enable a prismjs plugin. At least not obvious to me.

What problem does this feature solve?

It would allow an easy way for people to use prismjs plugins. It would allow people to swap out and use a different markdown-it code highlight plugin.

What does the proposed API look like?

Not applicable

How should this be implemented in your opinion?

One thing we can do here is that instead of using the npm package prismjs for code highlighting we could instead use the markdown-it plugin markdown-it-prism which would make code highlighting just another markdown extension that we can enable by default, and it would give people more control over prism options.

Are you willing to work on this yourself?

I have no experience contributing and not really sure how to.

DhruvDh commented 5 years ago

I searched through the issues and realised it would also solve issue #1823 and that this is kind of a duplicate of #1147.

flozero commented 4 years ago

We need to have a look for it. I agree to use markdown it plugin instead of the primjs server.

But as far as i know. I am not sure even if we use the markdon plugin it will cover all primjs feature