Open drammock opened 11 months ago
Thanks for opening this issue @drammock - I will look into these improvements. But since I am going to be on a few weeks leave this fix might only be available in a month or so.
I was talking with @trallard and I believe there are a few things we can try/do.
I believe it is possible to highlight not only the diff but the underlying language as well. This raise some questions, how do you handle colors, the way other things handle this is that inserted/removed only change the background of the lines.
Over at Pydata-Sphinx-Theme we've had a user request to support
.diff
highlighting: https://github.com/pydata/pydata-sphinx-theme/issues/1506I 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 undefinedGeneric.Deleted
,Generic.Heading
andGeneric.Subheading
are all defined as the same color (Colors.blue
)https://github.com/Quansight-Labs/accessible-pygments/blob/58caf8c2441670664fd01697688090fd914bfbfb/a11y_pygments/a11y_high_contrast_dark/style.py#L94-L104
I think what is needed is to define
Inserted
asColors.green
, changeDeleted
toColors.red
, and (maybe?) change eitherHeading
orSubheading
so they are different from one another. The addition ofInserted
probably means that agi
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, andHeading
is undefined.https://github.com/pygments/pygments/blob/8f3bec7982ba52915ee95f34f18e188243364600/pygments/styles/monokai.py#L100-L111