Pygments lexers for Git output and files.
Project description
Pygments lexers for Git output and files.
Get better at command line Git with my book Boost Your Git DX.
Installation
Use pip:
python -m pip install pygments-git
Python 3.9 to 3.14 supported.
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-attributes
A lexer for .gitattributes files.
git-blame-ignore-revs
A lexer for the file format used by blame.ignoreRevsFile. The de facto name for a repository-wide ignore file is .git-blame-ignore-revs, as recognized by GitHub and potentially other Git hosting services.
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-ignore
A lexer for .gitignore files.
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pygments_git-1.9.0.tar.gz.
File metadata
- Download URL: pygments_git-1.9.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c046801442fd39c9f6a265ebd9dd536ca8310a0e805be3e5ace6b11629de4d80
|
|
| MD5 |
c4b0966787ddb6ad87669488d006065c
|
|
| BLAKE2b-256 |
1c20970597e8e64b4e809f2163c10568c863fafec514c2459e9785b1e6e92132
|
Provenance
The following attestation bundles were made for pygments_git-1.9.0.tar.gz:
Publisher:
main.yml on adamchainz/pygments-git
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pygments_git-1.9.0.tar.gz -
Subject digest:
c046801442fd39c9f6a265ebd9dd536ca8310a0e805be3e5ace6b11629de4d80 - Sigstore transparency entry: 487791642
- Sigstore integration time:
-
Permalink:
adamchainz/pygments-git@38e2217f69f18ed41039663a5a88e8c60088c4aa -
Branch / Tag:
refs/tags/1.9.0 - Owner: https://github.com/adamchainz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@38e2217f69f18ed41039663a5a88e8c60088c4aa -
Trigger Event:
push
-
Statement type:
File details
Details for the file pygments_git-1.9.0-py3-none-any.whl.
File metadata
- Download URL: pygments_git-1.9.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be553368e6a2d3320c700c62c5468ed0a929a230fc8587f4ea9279e513274603
|
|
| MD5 |
eb612e0c8507fd87690978b564e741a1
|
|
| BLAKE2b-256 |
54e3b9ee5c7ed415781493d186b9fe4d25e594fb69bea7085f57ad905c49b34b
|
Provenance
The following attestation bundles were made for pygments_git-1.9.0-py3-none-any.whl:
Publisher:
main.yml on adamchainz/pygments-git
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pygments_git-1.9.0-py3-none-any.whl -
Subject digest:
be553368e6a2d3320c700c62c5468ed0a929a230fc8587f4ea9279e513274603 - Sigstore transparency entry: 487791672
- Sigstore integration time:
-
Permalink:
adamchainz/pygments-git@38e2217f69f18ed41039663a5a88e8c60088c4aa -
Branch / Tag:
refs/tags/1.9.0 - Owner: https://github.com/adamchainz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@38e2217f69f18ed41039663a5a88e8c60088c4aa -
Trigger Event:
push
-
Statement type: