This post is made for people who need to quickly pick a style of Pygments Styles. I wrote a script just to generate the list of code blocks each with different style, using itself as example code to highlight.

Note

This was first created on YJL -wiki with Pygments 1.5 at 2012/06/02 09:20:24-09:43:08.

page background color to .

Pygments version: 2.0.1

1   autumn

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()

2   borland

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()

3   bw

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()

4   colorful

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()

5   default

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()

6   emacs

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()

7   friendly

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()

8   fruity

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()

9   igor

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()

10   manni

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()

11   monokai

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()

12   murphy

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()

13   native

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()

14   paraiso-dark

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()

15   paraiso-light

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()

16   pastie

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()

17   perldoc

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()

18   rrt

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()

19   tango

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()

20   trac

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()

21   vim

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()

22   vs

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()

23   xcode

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys

import pygments
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
from pygments.styles import get_all_styles

style_block = <style>\n%s\n</style>

with open(sys.argv[0]) as f:
  # skip the heading comments
  code = f.read().split(\n\n, 1)[1]

print(Pygments version: %s % pygments.__version__)
print()

indent = lambda s:    + s.replace(\n, \n  )
for style in sorted(get_all_styles()):
  class_tag = pygments-%s % style
  print(%s % style)
  print(%s % (= * len(style)))
  print()
  formatter = HtmlFormatter(linenos=True, cssclass=class_tag, style=style)
  print(.. raw:: html\n)
  print(indent(style_block % formatter.get_style_defs(. + class_tag)))
  print(indent(highlight(code, PythonLexer(), formatter)))
  print()