Skip to content

Instantly share code, notes, and snippets.

@Kwpolska
Created March 23, 2013 12:48
Show Gist options
  • Save Kwpolska/5227609 to your computer and use it in GitHub Desktop.
Save Kwpolska/5227609 to your computer and use it in GitHub Desktop.
Pygments CSS generator
import pygments.formatters
import pygments.styles
def get_pygments_css(pygments_style):
"""Get the CSS for a Pygments style."""
return pygments.formatters.HtmlFormatter(style=pygments.styles.get_style_by_name(pygments_style)).get_style_defs('.code')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment