Skip to main content

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

Project description

sphinxcontrib-archware

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.

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.0.1.tar.gz (17.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.0.1-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sphinxcontrib_archware-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8a205c68d1346e68f6b03769b8a8b7b70f37d4a04d5feb26ffe0161cbc5b498f
MD5 32060b42cad547b1199520a86b350f4f
BLAKE2b-256 77dd9665e9175079b3c33aa342a94f0d653446d03de50d515590e175746e9a2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinxcontrib_archware-0.0.1.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.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinxcontrib_archware-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fd456f8cff8ff81a08415b9d3fb6ae4d376ca08780c714d1ab45bba89edc676a
MD5 a0329544c0b252a0c5d0d56034470a66
BLAKE2b-256 c96239f5304a09c89f4bdea5fa9408480126baa326b308f9cf15b5feae69eae2

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinxcontrib_archware-0.0.1-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