3 pygments.styles |
3 pygments.styles |
4 ~~~~~~~~~~~~~~~ |
4 ~~~~~~~~~~~~~~~ |
5 |
5 |
6 Contains built-in styles. |
6 Contains built-in styles. |
7 |
7 |
8 :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. |
8 :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. |
9 :license: BSD, see LICENSE for details. |
9 :license: BSD, see LICENSE for details. |
10 """ |
10 """ |
11 |
11 |
12 from pygments.plugin import find_plugin_styles |
12 from pygments.plugin import find_plugin_styles |
13 from pygments.util import ClassNotFound |
13 from pygments.util import ClassNotFound |
77 except AttributeError: |
77 except AttributeError: |
78 raise ClassNotFound("Could not find style class %r in style module." % cls) |
78 raise ClassNotFound("Could not find style class %r in style module." % cls) |
79 |
79 |
80 |
80 |
81 def get_all_styles(): |
81 def get_all_styles(): |
82 """Return an generator for all styles by name, |
82 """Return a generator for all styles by name, |
83 both builtin and plugin.""" |
83 both builtin and plugin.""" |
84 yield from STYLE_MAP |
84 yield from STYLE_MAP |
85 for name, _ in find_plugin_styles(): |
85 for name, _ in find_plugin_styles(): |
86 yield name |
86 yield name |