summaryrefslogtreecommitdiff
path: root/doc/docs
diff options
context:
space:
mode:
authorMatthäus G. Chajdas <dev@anteru.net>2019-12-06 19:29:29 +0100
committerMatthäus G. Chajdas <dev@anteru.net>2019-12-08 15:14:24 +0100
commit33cd11c4f1585254cb5e36a7e6fb40abf4456e4b (patch)
tree5048adbbcf0698611122e4b5881c0b39606c6256 /doc/docs
parentce17db4bde5602157bf261385dfc9206ad5fc709 (diff)
downloadpygments-git-33cd11c4f1585254cb5e36a7e6fb40abf4456e4b.tar.gz
Improve docs.
Add a contributing guide for newcomers, and remove references to pygmentize in the development docs. During development, there is no pygmentize.
Diffstat (limited to 'doc/docs')
-rw-r--r--doc/docs/lexerdevelopment.rst19
1 files changed, 10 insertions, 9 deletions
diff --git a/doc/docs/lexerdevelopment.rst b/doc/docs/lexerdevelopment.rst
index 5b6813fb..530d8c15 100644
--- a/doc/docs/lexerdevelopment.rst
+++ b/doc/docs/lexerdevelopment.rst
@@ -106,13 +106,13 @@ flag ``-x``:
.. code-block:: console
- $ pygmentize -l your_lexer_file.py -x
+ $ python -m pygments -l your_lexer_file.py -x
To specify a class name other than CustomLexer, append it with a colon:
.. code-block:: console
- $ pygmentize -l your_lexer.py:SomeLexer -x
+ $ python -m pygments -l your_lexer.py:SomeLexer -x
Or, using the Python API:
@@ -140,7 +140,7 @@ cloned from GitHub.
.. code-block:: console
- $ cd .../pygments-main
+ $ cd pygments
Select a matching module under ``pygments/lexers``, or create a new module for
your lexer class.
@@ -164,16 +164,17 @@ To test the new lexer, store an example file with the proper extension in
``tests/examplefiles``. For example, to test your ``DiffLexer``, add a
``tests/examplefiles/example.diff`` containing a sample diff output.
-Now you can use pygmentize to render your example to HTML:
+Now you can use ``python -m pygments`` from the current root of the checkout to
+render your example to HTML:
.. code-block:: console
- $ ./pygmentize -O full -f html -o /tmp/example.html tests/examplefiles/example.diff
+ $ python -m pygments -O full -f html -o /tmp/example.html tests/examplefiles/example.diff
-Note that this explicitly 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``).
+Note that this explicitly calls the ``pygments`` module in the current
+directory. 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``).
To view the result, open ``/tmp/example.html`` in your browser.