Hugo: Remove Pygments

Created on 11 Mar 2018  路  12Comments  路  Source: gohugoio/hugo

We now have Chroma as the default. I dont't see a reason to keep the old Python Pygments.

So, here is the plan:

1) Deprecate pygmentsuseclassic: true
2) Create aliases for the setting below below the map highlighter (or highlight?)

pygmentscodefences: true
pygmentscodefencesguesssyntax: false
pygmentsoptions: ""
pygmentsstyle: "friendly"
pygmentsuseclasses: true

We should maybe hold off with the docs update to the new values.

/cc @kaushalmodi

Enhancement Keep

Most helpful comment

So this is a fairly common open source problem when there are proportionally a lot of users and very few contributors.

The hard truth is that I just do not have the time or inclination to add full support for languages that are difficult to support (Perl6, YAML, etc.). So basically unless people start contributing lexers, or paying someone to, they're unlikely to get added.

Unfortunately that's the reality.

All 12 comments

That's awesome!

+1 for highlight.. highlightoptions, highlightstyle, .. sound great.

On another thought.. just being devil's advocate, Chroma is probably not a 100% replacement for Pygments at least for some folks (even though, it is for me). Pygments supports many options that Chroma does not.

So if Pygments is deprecated, it will be terrible for the folks using the Pygments options unavailable in Chroma.

If it doesn't hurt (doesn't have maintenance headache), I'd suggest leaving Pygments in.


But my +1 for renaming the the pygments* options to highlight* options still stands!

The Chroma highlighter still has some Ruby bugs, which Pygments does not, and it's probably not the only language. How long will Pygments continue to be available after deprecation?

@mckern it is usually the deprecation version +1. But do not worry, the cost of keeping the Pygments integration is low, so I'll just keep this as a tracking issue and revisit once Chroma is fully stable. At some point I want to get rid of that extra code, but no rush.

Great, thank you so much for the follow up!

This is done.

Chroma doesn't support Raku(formerly known as Perl 6). :disappointed:

@CIAvash, open an issue with chroma.

@moorereason I saw this:

perl6: Requires a bunch of helpers that I do not have the time to convert.

in this file and got discouraged on opening an issue. But I will open one.

So this is a fairly common open source problem when there are proportionally a lot of users and very few contributors.

The hard truth is that I just do not have the time or inclination to add full support for languages that are difficult to support (Perl6, YAML, etc.). So basically unless people start contributing lexers, or paying someone to, they're unlikely to get added.

Unfortunately that's the reality.

That said I forgot an idea I had, build a converter or importer for Textmate or Sublime syntax files. These files do not contain any custom code, so assuming full support in Chroma and the syntax file, the support would be complete.

The problem is I've had some difficulty finding documentation for the format, so if anyone knows where to find docs, or is willing to write an importer, that would be welcome.

Was this page helpful?
0 / 5 - 0 ratings