Skip to main content
https://img.shields.io/github/actions/workflow/status/adamchainz/pygments-git/main.yml?branch=main&style=for-the-badge https://img.shields.io/badge/Coverage-100%25-success?style=for-the-badge https://img.shields.io/pypi/v/pygments-git.svg?style=for-the-badge https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge pre-commit

Pygments lexers for Git output and files.

Installation

Use pip:

python -m pip install pygments-git

Python 3.7 to 3.11 supported.


Working on a Django project? Improve your skills with one of my books.


Usage

With the package installed, Pygments will autodiscover the below lexers.

When using Pygments directly, you can refer to them by name. Within Sphinx/docutils, you can refer to them in code-block directives:

.. code-block:: git-console

    $ git log --oneline
    82fbbd3 D'oh! Fix math proof
    91e9879 Aye carumba! Grammar mistake
    61c4c08 Cowabunga! Update bibliography

To preview the lexers, open the tests/index.html file within the repository.

git-commit-edit-msg

A lexer for the COMMIT_EDITMSG file that Git opens when you run git commit. It calls out to DiffLexer for highlighting any diff, as added by git commit --verbose.

git-conflict-markers

A lexer for the conflict markers that Git adds to indicate conflicts during a merge. All other text in the file is lexed as plain text.

git-console

A lexer for interactive shell sessions with Git. It calls out to BashLexer for highlighting commands on lines starting with a $ and DiffLexer for highlighting inline diffs.

git-rebase-todo

A lexer for the git-rebase-todo file that Git opens when you run git rebase --interactive. It calls out to BashLexer for highlighting commands on lines starting with x or exerc a $ and DiffLexer for highlighting inline diffs.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygments_git-1.2.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygments_git-1.2.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file pygments_git-1.2.0.tar.gz.

File metadata

  • Download URL: pygments_git-1.2.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for pygments_git-1.2.0.tar.gz
Algorithm Hash digest
SHA256 2038491327933b13ab276bdda74791ebaf3bbec1dfdd070e97c53ac0d4b491cb
MD5 33fc18a15159c0c5b2ee90363e7d8f6e
BLAKE2b-256 a24ad0dfd0b24418c4dacb946b4de8bcbccbdb8aa1f4a6446757efb36d09e5ec

See more details on using hashes here.

File details

Details for the file pygments_git-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: pygments_git-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for pygments_git-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5861e3b44c5f80bca187e5f7ed34fe8b169cd80d72fa0c8cb248740c7a10b251
MD5 864fd879675f7196ede36d3e672ab246
BLAKE2b-256 3f356c4aa90ee2741fd6182b821072759c89d07a1a1c77e7b521d86450c7c573

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page