Open hologerry opened 5 years ago
Have the same issue.
Problem seems to be that pygments
inserts color codes directly in <span>
tags, so there's no easy way to apply different CSS on them. It differs from how (now defunct) Power Format Pack used to work: by wrapping code elements in divs with classes.
So for now I just added alpha to background color of codehilite
class directly in pygments
style:
# Anki2/addons21/1030875226/pygments/styles/<name of your style from addon config, I use Monokai>
class MonokaiStyle(Style):
"""
This style mimics the Monokai color scheme.
"""
background_color = "#ffffff00" # <-- Zeroes for alpha in background
highlight_color = "#49483e"
Though other colors still look not so good in dark mode
It took me a bit of digging to figure out how to implement @suvernev-d's suggestion.
Here's how to implement his suggestion:
In Anki, go to Tools > Addons
Select the Auto Markdown
package and click the Config
button
In the following object, make sure that colorScheme
is set to monokai
. (I also turned off lineNum
s.
Click OK
.
The modal window will go away, you should be back on the Tools > Addons
window.
Click the View Files
button.
Open up the pygments/styles
directory, and open monokai.py
in your text editor:
On line 23, change the value for background_color
from #272822
to #ffffff00
, per @suvernev-d's comment.
Restart Anki, and try using Markdown!
@josh-works Thanks a lot!