Skip to content

feature request: support diff highlighting #31

@drammock

Description

@drammock

Over at Pydata-Sphinx-Theme we've had a user request to support .diff highlighting: pydata/pydata-sphinx-theme#1506

I haven't looked at all the themes in this repo, but I looked at a11y_high_contrast_dark and _light and here is (I think) the problem:

  • Generic.Inserted is undefined
  • Generic.Deleted, Generic.Heading and Generic.Subheading are all defined as the same color (Colors.blue)

# Generic: "", # class: 'g'
Generic.Deleted: Colors.blue, # class: 'gd',
Generic.Emph: "italic", # class: 'ge'
# Generic.Error: "", # class: 'gr'
Generic.Heading: Colors.blue, # class: 'gh'
Generic.Subheading: Colors.blue, # class: 'gu'
# Generic.Inserted: "", # class: 'gi'
# Generic.Output: "", # class: 'go'
# Generic.Prompt: "", # class: 'gp'
Generic.Strong: "bold", # class: 'gs'
# Generic.Traceback: "", # class: 'gt'

I think what is needed is to define Inserted as Colors.green, change Deleted to Colors.red, and (maybe?) change either Heading or Subheading so they are different from one another. The addition of Inserted probably means that a gi class should get added to the CSS files too (unless those are auto-generated? I don't have much experience with pygments development).

For reference, in Monokai (which has better diff highlighting), Deleted is pink, Inserted is a light-yellowish-green, Subheading is a sort of greenish-light-grey, and Heading is undefined.

https://github.com/pygments/pygments/blob/8f3bec7982ba52915ee95f34f18e188243364600/pygments/styles/monokai.py#L100-L111

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions