summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorThomas Aglassinger <roskakori@users.sourceforge.net>2013-04-02 02:17:28 +0200
committerThomas Aglassinger <roskakori@users.sourceforge.net>2013-04-02 02:17:28 +0200
commite71998052c832120301e56ed799f0ea77207354a (patch)
tree6bbab9cbe626a6cbc7ff0f9b24a42dfe47cc1883 /docs
parentf943519622bb8b47e01d467bed181acc39b64c34 (diff)
downloadpygments-e71998052c832120301e56ed799f0ea77207354a.tar.gz
Simplified adding and testing a new lexer by referring to the Makefile.
Diffstat (limited to 'docs')
-rw-r--r--docs/src/lexerdevelopment.txt23
1 files changed, 7 insertions, 16 deletions
diff --git a/docs/src/lexerdevelopment.txt b/docs/src/lexerdevelopment.txt
index 9a227c2b..730a08b2 100644
--- a/docs/src/lexerdevelopment.txt
+++ b/docs/src/lexerdevelopment.txt
@@ -102,23 +102,14 @@ the ``pygments.lexers`` specify ``__all__``. For example, ``other.py`` sets:
__all__ = ['BrainfuckLexer', 'BefungeLexer', ...]
-Simply add the name of you lexer class to this list.
+Simply add the name of your lexer class to this list.
-Now update the ``python.lexers._mapping``. This is a generated module which
-can update itself by changing the current directory to its location and
-running it:
+Finally the lexer can be made publically known by rebuilding the lexer
+mapping:
.. sourcecode:: console
- $ cd pygments/lexers/
- $ python _mapping.py
- $ cd ../..
-
-Without the ``cd`` command, you will get an ``ImportError``:
-
-.. sourcecode:: pycon
-
- ImportError: No module named ez_setup
+ $ make mapfiles
To test the new lexer, store an example file with the proper extension in
``tests/examplefiles``. For example, to test your ``DiffLexer``, add a
@@ -130,8 +121,8 @@ Now you can use pygmentize to render your example to HTML:
$ ./pygmentize -O full -f html -o /tmp/example.html tests/examplefiles/example.diff
-Note that we explicitely call the ``pygmentize`` in the current directory by
-preceding it with ``./``. This ensures your modifications are used.
+Note that this explicitely calls the ``pygmentize`` in the current directory
+by preceding it with ``./``. This ensures your modifications are used.
Otherwise a possibly already installed, unmodified version without your new
lexer would have been called from the system search path (``$PATH``).
@@ -141,7 +132,7 @@ Once the example renders as expected, you should run the complete test suite:
.. sourcecode:: console
- $ python tests/run.py
+ $ make test
Regex Flags