statiqdev / Statiq.Web

Statiq Web is a flexible static site generator written in .NET.
https://statiq.dev/web
Other
1.65k stars 235 forks source link

[Question] Is is possible to improve syntax highlighting ? #886

Closed TechWatching closed 2 years ago

TechWatching commented 4 years ago

Would it be possible to improve syntax highlighting in wyam (or statiq) and use something similar to what docfx uses to render code ? I don't know what it is and if it's usabled from outside docfx but code is really nice to read on docs.microsoft.com pages.

With Wyam.Highlight we have syntax highlighting but code is not really easy to read, I sometimes prefer using Github gists where the syntax highlighting is better but that means the code lives outside the blog post and I have to pay attention not to delete the gists.

daveaglick commented 4 years ago

There’s essentially two ways a static generator can highlight code blocks:

Either approach is fine and there’s trade offs to each. In Statiq going forward I’m thinking this should be entirely theme driven. Some themes will use the latter model and highlight on the client. Other themes may want to manipulate the generation pipelines at highlight at generation-time (which is a capability that’s new to Statiq - Wyam doesn’t have a good way for a theme to manipulate pipelines).

TL;DR: I’m hopeful Statiq (and more specifically Statiq themes) will be an improvement in regards to code highlighting.

daveaglick commented 2 years ago

With the next release of Statiq Web it can either highlight code on the client or at generation time depending on a setting, and can do so in any number of languages using highlight.js. That's probably as good as it's going to get without a more specific request so I'll consider this issue resolved.