diff options
author | Mauricio Caceres Bravo <mauricio.caceres.bravo@gmail.com> | 2019-02-12 10:27:34 -0500 |
---|---|---|
committer | Mauricio Caceres Bravo <mauricio.caceres.bravo@gmail.com> | 2019-02-12 10:27:34 -0500 |
commit | 62ff49874c8a405fc24a83cb6611e8a5cf818bd5 (patch) | |
tree | 8b33912d57eb8bedcc75f30f146608ea59f43e8a /doc/docs/cmdline.rst | |
parent | df656b31ecabd8a1b649f79de050854a2974e395 (diff) | |
parent | 77e24d5ab193f6c3fa8492f5410a2e841f9ebfad (diff) | |
download | pygments-62ff49874c8a405fc24a83cb6611e8a5cf818bd5.tar.gz |
Merged default branch to hopefully solve merge conflicts
Diffstat (limited to 'doc/docs/cmdline.rst')
-rw-r--r-- | doc/docs/cmdline.rst | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/docs/cmdline.rst b/doc/docs/cmdline.rst index 165af969..e4f94ea5 100644 --- a/doc/docs/cmdline.rst +++ b/doc/docs/cmdline.rst @@ -99,6 +99,23 @@ The ``-N`` option guesses a lexer name for a given filename, so that :: will print out ``python``. It won't highlight anything yet. If no specific lexer is known for that filename, ``text`` is printed. +Custom Lexers and Formatters +---------------------------- + +.. versionadded:: 2.2 + +The ``-x`` flag enables custom lexers and formatters to be loaded +from files relative to the current directory. Create a file with a class named +CustomLexer or CustomFormatter, then specify it on the command line:: + + $ pygmentize -l your_lexer.py -f your_formatter.py -x + +You can also specify the name of your class with a colon:: + + $ pygmentize -l your_lexer.py:SomeLexer -x + +For more information, see :doc:`the Pygments documentation on Lexer development +<lexerdevelopment>`. Getting help ------------ |