diff options
author | Matthäus G. Chajdas <dev@anteru.net> | 2020-08-23 18:52:45 +0200 |
---|---|---|
committer | Matthäus G. Chajdas <dev@anteru.net> | 2020-08-23 18:52:45 +0200 |
commit | 9ef94104d928bb0c26da26fb711b0490ec401123 (patch) | |
tree | e7807b3631871af033a86cf2b8c41dd736343ee4 /doc/docs | |
parent | 245afa32151a438e1f65f01770b8519f5b1601c7 (diff) | |
download | pygments-git-9ef94104d928bb0c26da26fb711b0490ec401123.tar.gz |
Spell out that we want lexers in separate files.
Diffstat (limited to 'doc/docs')
-rw-r--r-- | doc/docs/lexerdevelopment.rst | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/docs/lexerdevelopment.rst b/doc/docs/lexerdevelopment.rst index c673b48e..27e5300e 100644 --- a/doc/docs/lexerdevelopment.rst +++ b/doc/docs/lexerdevelopment.rst @@ -20,7 +20,6 @@ containing tuples in the form ``(index, token, value)``. Normally you don't need to do this since there are base lexers that do most of the work and that you can subclass. - RegexLexer ========== @@ -148,6 +147,11 @@ cloned from GitHub. Select a matching module under ``pygments/lexers``, or create a new module for your lexer class. +.. note:: + + We encourage you to put your lexer class into its own module, unless it's a + very small derivative of an already existing lexer. + Next, make sure the lexer is known from outside of the module. All modules in the ``pygments.lexers`` package specify ``__all__``. For example, ``esoteric.py`` sets:: |