typelevel / Laika

Site and E-book Generator and Customizable Text Markup Transformer for sbt, Scala and Scala.js
https://typelevel.org/Laika/
Apache License 2.0
406 stars 44 forks source link

Add support for diff syntax highlighting #565

Closed danicheg closed 3 months ago

danicheg commented 6 months ago

Hey there! This is more likely a feature request rather than a bug. How tough will it be to implement diff syntax highlighting? The way it's done in Github:

- foo
+ bar

In http4s, I've tried to use it but got a regular markdown code block:

Screenshot 2024-01-04 at 15 48 39
jenshalm commented 6 months ago

Just to clarify: you are referring to explicit diff blocks which are marked with ```diff and not to adding diff highlighting to existing language highlighters? I'm asking as the former would be fairly straightforward while the latter would be really messy.

danicheg commented 6 months ago

Sure, only diff-blocks highlighting. Event Github doesn't support diff highlighting alongside language highlighting.

jenshalm commented 6 months ago

Ok, that makes it more realistic it'll go into the next minor (1.1.0).

On a general note, my personal focus post 1.0 is now maintenance (bug fixes, dependency updates and minor usability enhancements), so feature requests will now require contributions most of the time. However, this one is so trivial I can as well just quickly do it myself once I start to look at 1.1.0 (most likely right after 1.0.1).

danicheg commented 6 months ago

With a little guidance, I could maybe try to implement it. But I also don't mind if you implement it when planned.

jenshalm commented 6 months ago

Thanks for the offer. For this request it might be simpler if I just do it myself, since it's less than 15 minutes of work. My remark was more general for potential future feature requests that require more work.

danicheg commented 6 months ago

NP! Thanks 👍🏻