hugo icon indicating copy to clipboard operation
hugo copied to clipboard

Use short token for code highlighting

Open stephenfin opened this issue 7 years ago • 10 comments

Closes: #5349

As noted in #5349, rst2html can generate HTML with short or long form class names for syntax highlighting. Pygments (via the pygmentize command) seems to generate short form by default without any way to switch this. This means most/any stylesheets for code provided with various themes won't work when using rST output. This can easily be fixed by providing the --syntax-highlight=short flag to rst2html.

stephenfin avatar Oct 24 '18 13:10 stephenfin

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Oct 24 '18 13:10 CLAassistant

I don't know enough about RsT to merge this. I'm mostly concerned if this new flag will somehow break in some RsT versions.

@anthonyfok any input? others?

bep avatar Aug 01 '19 11:08 bep

I don't know enough about RsT to merge this. I'm mostly concerned if this new flag will somehow break in some RsT versions.

The flag has been present in docutils since at least 0.9.1, which was released in 2012. Ubuntu 16.04 uses 0.12. I think this is pretty safe now.

stephenfin avatar Aug 02 '19 10:08 stephenfin

Looks like there's now a merge conflict because the location of this code changed. If I were to rebase this PR, would that be somethign that could merged, or are there larger concerns?

alex avatar May 17 '20 19:05 alex

I've rebased this. It's definitely safe

stephenfin avatar May 18 '20 10:05 stephenfin

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open. If this is a feature request, and you feel that it is still relevant and valuable, please tell us why. This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

stale[bot] avatar Aug 16 '20 11:08 stale[bot]

This is still valid. Let me know if I can help explain anything

stephenfin avatar Aug 16 '20 20:08 stephenfin

@stephenfin looks like there's a merge conflict to resolve here.

sumnerevans avatar Sep 24 '20 14:09 sumnerevans

As I said, I don't know enough about this to review this.

bep avatar Dec 02 '20 11:12 bep

I have tested this, and I'm using it in my fork of hugo.

I also created #7763 which solves this issue as well as an issue with math formatting in reStructuredText, if you want to merge that one instead. One benefit of #7763 is that there are tests so you can see the expected output more clearly.

sumnerevans avatar May 31 '21 04:05 sumnerevans