summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2020-08-23 18:46:32 +0200
committerGeorg Brandl <georg@python.org>2020-08-23 18:46:37 +0200
commit245afa32151a438e1f65f01770b8519f5b1601c7 (patch)
tree183d4f9dae5d2486766da56343e8081ce3e95d43
parent2a762c5fe655a3b3ecc9c52422300b9430110758 (diff)
downloadpygments-git-245afa32151a438e1f65f01770b8519f5b1601c7.tar.gz
docs: clarify cmdline invocation in lexer dev section
closes #1518
-rw-r--r--doc/docs/lexerdevelopment.rst9
1 files changed, 6 insertions, 3 deletions
diff --git a/doc/docs/lexerdevelopment.rst b/doc/docs/lexerdevelopment.rst
index c776457b..c673b48e 100644
--- a/doc/docs/lexerdevelopment.rst
+++ b/doc/docs/lexerdevelopment.rst
@@ -101,18 +101,21 @@ First, change the name of your lexer class to CustomLexer:
class CustomLexer(RegexLexer):
"""All your lexer code goes here!"""
-Then you can load the lexer from the command line with the additional
+Then you can load and test the lexer from the command line with the additional
flag ``-x``:
.. code-block:: console
- $ python -m pygments -l your_lexer_file.py -x
+ $ python -m pygments -x -l your_lexer_file.py <inputfile>
To specify a class name other than CustomLexer, append it with a colon:
.. code-block:: console
- $ python -m pygments -l your_lexer.py:SomeLexer -x
+ $ python -m pygments -x -l your_lexer.py:SomeLexer <inputfile>
+
+Use the ``-f`` flag to select a different output format than terminal
+escape sequences.
Or, using the Python API: