Skip to main content

Sphinx extension to render bytefield and register hardware diagrams as SVG.

Project description

sphinxcontrib-archware

Documentation Status PyPI version

A Sphinx extension for documenting digital hardware in RST.

It provides directives for rendering bytefield packet and register diagrams and register hardware register diagrams as inline SVG in HTML output, and as native LaTeX floats in PDF output.

Examples

Light Mode (default, black stroke) Dark Mode (white stroke)
Memory layout (black stroke)
Memory layout (white stroke)
Register Mapping (black stroke)
Register Mapping (white stroke)
Frame layout (black stroke)
Frame layout (white stroke)

Directives

Directive Description
.. bytefield:: Packet / bit-field diagram
.. register:: Hardware register diagram with rotated field names and reset values
.. regdesc:: Field descriptions as searchable HTML text
.. listofregisters:: Auto-generated list of all register diagrams

Custom commands \colorbitbox, \bitlabel, \rotbitheader, \memsection, and \descbox are always available in every .. bytefield:: directive with no extra configuration.

Installing the Python package

pip install sphinxcontrib-archware

Then add the extension to conf.py:

extensions = ["sphinxcontrib.archware"]

Installing the required TeX tools

The extension requires a TeX installation with the bytefield and register LaTeX packages, and a tool to convert the compiled output to SVG.

Debian / Ubuntu

# TeX Live with the required LaTeX packages
sudo apt install texlive-latex-extra texlive-pictures texlive-science

# SVG converter — dvisvgm is included in texlive-base;
# install inkscape as an alternative if preferred
sudo apt install dvisvgm        # recommended
# or
sudo apt install inkscape

macOS (Homebrew)

# MacTeX includes all required LaTeX packages and dvisvgm
brew install --cask mactex

# or the smaller BasicTeX distribution, then add the missing packages:
brew install --cask basictex
sudo tlmgr update --self
sudo tlmgr install bytefield register standalone lm

Windows (MiKTeX)

Install MiKTeX. The bytefield and register packages will be downloaded automatically on first use. Install dvisvgm via the MiKTeX package manager, or install Inkscape as the SVG converter.

Verifying the installation

latex  --version      # should print a LaTeX version string
dvisvgm --version     # should print a dvisvgm version string

Global package options

Package-level options for the LaTeX packages can be set globally in conf.py and apply to every diagram in the document:

# options forwarded to \usepackage[…]{bytefield}
bytefield_package_options = "bitheight=6ex"

# options forwarded to \usepackage[…]{register}
register_package_options = "botcaption"

Development note

This package was developed interactively with Claude (Anthropic) as a coding and documentation assistant. All output was reviewed and directed by the author.

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_archware-0.2.0.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

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

sphinxcontrib_archware-0.2.0-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file sphinxcontrib_archware-0.2.0.tar.gz.

File metadata

  • Download URL: sphinxcontrib_archware-0.2.0.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sphinxcontrib_archware-0.2.0.tar.gz
Algorithm Hash digest
SHA256 adc9fa9087147cf52c5fe9802674d108b1f2f94e0b7996e05383ad971a850a68
MD5 157cac4f710307a885d1a75e972f61fa
BLAKE2b-256 e42585927456d59cf9cb806ca7087c694be42b1cac51eb2d8f1056f499b2a976

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinxcontrib_archware-0.2.0.tar.gz:

Publisher: publish.yml on AAGandomi/sphinxcontrib-archware

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_archware-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinxcontrib_archware-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ccdcf293b33f9e6d7d02e3e5ce72f08d79cbc63575b08cb2d74f64ca2575458
MD5 4b638bf8f78e3db4016798fb1ef1af32
BLAKE2b-256 d187b6f95da16c2b7757e9b6b1fac274e0e9492e7fe5ec2480ef991880c8cc5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinxcontrib_archware-0.2.0-py3-none-any.whl:

Publisher: publish.yml on AAGandomi/sphinxcontrib-archware

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