There was an error while loading. Please reload this page.
1 parent f69bc44 commit dfed263Copy full SHA for dfed263
prompt_toolkit/layout/lexers.py
@@ -150,6 +150,17 @@ class PygmentsLexer(Lexer):
150
"""
151
Lexer that calls a pygments lexer.
152
153
+ Example::
154
+
155
+ from pygments.lexers import HtmlLexer
156
+ lexer = PygmentsLexer(HtmlLexer)
157
158
+ Note: Don't forget to also load a Pygments compatible style. E.g.::
159
160
+ from prompt_toolkit.styles.from_pygments import style_from_pygments
161
+ from pygments.styles import get_style_by_name
162
+ style = style_from_pygments(get_style_by_name('monokai'))
163
164
:param pygments_lexer_cls: A `Lexer` from Pygments.
165
:param sync_from_start: Start lexing at the start of the document. This
166
will always give the best results, but it will be slow for bigger
0 commit comments