Skip to main content

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, default 16
  • :lowercase: flag; if present, byte hex values are lowercase (default is uppercase)
  • :start: integer >= 0, default 0
  • :length: integer >= 0, default 0 (read until EOF)
  • :max-lines: integer >= 0, default 0 (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


Download files

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

Source Distribution

sphinxcontrib_hexdump-0.1.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

sphinxcontrib_hexdump-0.1.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

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

Hashes for sphinxcontrib_hexdump-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6c578806c9e8a6eee6f5ff5ab46461e511164f8ca831acd8b8578729a24947d2
MD5 8fbc20d91f6dc31c66d32db5a55ba50d
BLAKE2b-256 4cb1a5aca4ba41a4a4c4588f295a5f03d7010e86fc1c7fe15846aa36eba8b7c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinxcontrib_hexdump-0.1.0.tar.gz:

Publisher: publish.yml on idduarte/sphinxcontrib-hexdump

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sphinxcontrib_hexdump-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinxcontrib_hexdump-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dcf2d2ae435a1f51fc3f74cc254e5017e02ab0cb78e4fd85f096cdd6b689000e
MD5 65cffaeb00538acac04730837df49468
BLAKE2b-256 db2982de1307b776d464c3cd789a72c9c8a3429a7f1081ed3ec77f0a05ca1581

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinxcontrib_hexdump-0.1.0-py3-none-any.whl:

Publisher: publish.yml on idduarte/sphinxcontrib-hexdump

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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