lightbend / paradox

Markdown documentation
https://developer.lightbend.com/docs/paradox/current
Apache License 2.0
245 stars 76 forks source link

Option to use highlightjs for syntax highlighting #450

Open harpocrates opened 3 years ago

harpocrates commented 3 years ago

The API for highlightjs seems to be pretty much the same as prettyify. I think both are quite widely used. However,

Would it be feasible to add an option for choosing the syntax highlighting library to use?

ennru commented 3 years ago

Sure, I would be OK with switching to highlightjs and dropping prettify.

Are you in a position to suggest the necessary changes in a PR?

harpocrates commented 3 years ago

Are you in a position to suggest the necessary changes in a PR?

Not yet - I wanted to check this would be well-received first before moving forward with the actual changes. Are you sure it is OK to drop prettify, or should it be kept around as an option (checking as I imagine highlightjs will have subtly different syntax definitions and color schemes such that code in existing doc projects like akka-docs might end up looking slightly different)?

ennru commented 3 years ago

I don't think it is a problem if the syntax colouring slightly changes. highlightjs seems to offer a vast set of predefined designs. Configuring that will be more useful than switching between prettify and highlightjs.

harpocrates commented 3 years ago

OK thanks; that definitely lowers the bar for changes I'd have to make/test. I'll aim to open a PR for this in the next week or so.

raboof commented 3 years ago

Going straight for highlightjs seems fine to me too.

I'm not sure if the fiddle integration interacts with the syntax highlighting at all - that might be one thing to double-check.

pvlugter commented 3 years ago

Switching to highlightjs sounds good to me too. Thanks @harpocrates