Sphinx directive to render deterministic monochrome hexdumps from binary files
Project description
sphinxcontrib-hexdump
sphinxcontrib-hexdump is a Sphinx extension that renders files as classic monochrome hexdumps using a reStructuredText directive.
Features
- Reads any file type as raw binary bytes.
- Produces deterministic output with pure Python formatting.
- Emits a single literal code block that works consistently in HTML and LaTeX builders.
- Supports offset/length/line limiting for large files.
Installation
pip install sphinxcontrib-hexdump
For local development:
pip install -e .[test]
Enable the extension
Add to conf.py:
extensions = [
"sphinxcontrib.hexdump",
]
Directive usage
.. hexdump:: ../artifacts/firmware.elf
:bytes-per-line: 16
:start: 0
:length: 256
:max-lines: 64
Lowercase bytes are optional:
.. hexdump:: ../artifacts/firmware.elf
:lowercase:
Options
:bytes-per-line:integer >= 1, default16:lowercase:flag; if present, byte hex values are lowercase (default is uppercase):start:integer >= 0, default0:length:integer >= 0, default0(read until EOF):max-lines:integer >= 0, default0(no line limit)
Notes
- Paths are resolved relative to the Sphinx source directory (
env.srcdir). - Files outside the docs directory are allowed if they exist.
- For very large files, prefer
:length:and/or:max-lines:to keep output size bounded.
Release
- TestPyPI and PyPI publishing workflows are included in
.github/workflows/. - Full release steps are documented in
PUBLISHING.md.
Compatibility
- Python 3.10+
- Sphinx 6.2+
License
MIT
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 sphinxcontrib_hexdump-0.1.0.tar.gz.
File metadata
- Download URL: sphinxcontrib_hexdump-0.1.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c578806c9e8a6eee6f5ff5ab46461e511164f8ca831acd8b8578729a24947d2
|
|
| MD5 |
8fbc20d91f6dc31c66d32db5a55ba50d
|
|
| BLAKE2b-256 |
4cb1a5aca4ba41a4a4c4588f295a5f03d7010e86fc1c7fe15846aa36eba8b7c1
|
Provenance
The following attestation bundles were made for sphinxcontrib_hexdump-0.1.0.tar.gz:
Publisher:
publish.yml on idduarte/sphinxcontrib-hexdump
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinxcontrib_hexdump-0.1.0.tar.gz -
Subject digest:
6c578806c9e8a6eee6f5ff5ab46461e511164f8ca831acd8b8578729a24947d2 - Sigstore transparency entry: 983622073
- Sigstore integration time:
-
Permalink:
idduarte/sphinxcontrib-hexdump@a29caaa7ac92aaaa741d6781090f5d2cf7dd61c7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/idduarte
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a29caaa7ac92aaaa741d6781090f5d2cf7dd61c7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sphinxcontrib_hexdump-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sphinxcontrib_hexdump-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.3 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 |
dcf2d2ae435a1f51fc3f74cc254e5017e02ab0cb78e4fd85f096cdd6b689000e
|
|
| MD5 |
65cffaeb00538acac04730837df49468
|
|
| BLAKE2b-256 |
db2982de1307b776d464c3cd789a72c9c8a3429a7f1081ed3ec77f0a05ca1581
|
Provenance
The following attestation bundles were made for sphinxcontrib_hexdump-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on idduarte/sphinxcontrib-hexdump
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinxcontrib_hexdump-0.1.0-py3-none-any.whl -
Subject digest:
dcf2d2ae435a1f51fc3f74cc254e5017e02ab0cb78e4fd85f096cdd6b689000e - Sigstore transparency entry: 983622076
- Sigstore integration time:
-
Permalink:
idduarte/sphinxcontrib-hexdump@a29caaa7ac92aaaa741d6781090f5d2cf7dd61c7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/idduarte
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a29caaa7ac92aaaa741d6781090f5d2cf7dd61c7 -
Trigger Event:
push
-
Statement type: