Skip to content

Update to new Github style? #1

Open

Description

@fladd

Hi there,

great Pygments style! I was wondering whether you have plans to update it reflect the current Github style?

image

Activity

  1. PhilipTrauner commented on Apr 7, 2020

    @PhilipTrauner
    Owner

    I was pretty surprised to hear that they've reworked the token style, as I've never noticed any changes. After comparing Markdown and how its rendered by different GitHub features I now know why: They don't seem to apply the new style everywhere.

    Here's a quick comparison:

    Unmodified pygmentsUnmodified pygments
    Modified pygmentsModified pygments
    GitHub Markdown PreviewGitHub Markdown Preview
    GitHub GistGitHub Gist

    Unmodified pygments still closely (within the constraints pointed out in the README.md) matches GitHub Markdown Preview.

    GitHub Gist is definitely different though, so I've tried to replicate it by making the following changes which are illustrated by Modified pygments.

    diff --git a/dist/style/github.css b/dist/style/github.css
    index 3af9410..359bd0f 100644
    --- a/dist/style/github.css
    +++ b/dist/style/github.css
    @@ -1,5 +1,5 @@
     .highlight .hll { background-color: #ffffcc }
    -.highlight  { background: #f8f8f8; }
    +.highlight  { background: #f6f8fa; }
     .highlight .c { color: #6a737d } /* Comment */
     .highlight .err {  } /* Error */
     .highlight .k { color: #d73a49 } /* Keyword */
    @@ -29,12 +29,12 @@
     .highlight .m { color: #666666 } /* Literal.Number */
     .highlight .s { color: #032f62 } /* Literal.String */
     .highlight .na { } /* Name.Attribute */
    -.highlight .nb { color: #005cc5 } /* Name.Builtin */
    -.highlight .nc { color: #6f42c1 } /* Name.Class */
    +.highlight .nb { color: #6f42c1 } /* Name.Builtin */
    +.highlight .nc { color: #e36209 } /* Name.Class */
     .highlight .no { color: #005cc5 } /* Name.Constant */
     .highlight .nd { color: #6f42c1 } /* Name.Decorator */
     .highlight .ni { color: #005cc5 } /* Name.Entity */
    -.highlight .ne { color: #005cc5 } /* Name.Exception */
    +.highlight .ne { color: #e36209 } /* Name.Exception */
     .highlight .nf { color: #6f42c1 } /* Name.Function */
     .highlight .nl { color: #005cc5 } /* Name.Label */
     .highlight .nn { color: #6f42c1 } /* Name.Namespace */

    I'm not opposed to pushing these to master, so please me know if you are satisfied with the result 🙂

  2. fladd commented on Apr 7, 2020

    @fladd
    Author

    Looks good.

    Some more observations:

    1. Shouldn't things like "is" and "not" in Python be blue, rather than orange.

    2. I also spotted some other differences in other languages (HTML, Ruby, C++). Not sure if they were related to changes at GitHub or due to limitations of Pygments.

      Have a look at those examples here: https://gist.github.com/fladd/3280e197f0b9d6958c25b121e7ac3390

    3. You could also consider switching on operators. Since they are blue now, the additional colouring of dots by Pygments is barely seen and not too distracting.

  3. fladd commented on Feb 25, 2021

    @fladd
    Author

    Any news on this?

  4. PhilipTrauner commented on Feb 26, 2021

    @PhilipTrauner
    Owner

    Don't have time to perform these changes right now, but would still be open to merging this in if you put together a PR. (please update the "Compromises" table as well) 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions