Skip to content

Instantly share code, notes, and snippets.

@crowsonkb
Created June 2, 2019 11:47
Show Gist options
  • Save crowsonkb/4e2eb4439e3fe514cc4755b217f164d5 to your computer and use it in GitHub Desktop.
Save crowsonkb/4e2eb4439e3fe514cc4755b217f164d5 to your computer and use it in GitHub Desktop.
Monkey patching pygments inside Sphinx documentation configuration
# The name of the Pygments (syntax highlighting) style to use.
sys.path.append('.')
import pygments.styles
import base16_spacemacs_kat
# pygments.styles.base16_spacemacs_kat = base16_spacemacs_kat
sys.modules['pygments.styles.' + 'base16_spacemacs_kat'] = base16_spacemacs_kat
pygments.styles.STYLE_MAP['base16-spacemacs-kat'] = 'base16_spacemacs_kat::Base16SpacemacsStyle'
pygments_style = 'base16-spacemacs-kat' # 'friendly'
@aroberge
Copy link

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