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
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_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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a205c68d1346e68f6b03769b8a8b7b70f37d4a04d5feb26ffe0161cbc5b498f
|
|
| MD5 |
32060b42cad547b1199520a86b350f4f
|
|
| BLAKE2b-256 |
77dd9665e9175079b3c33aa342a94f0d653446d03de50d515590e175746e9a2a
|
Provenance
The following attestation bundles were made for sphinxcontrib_archware-0.0.1.tar.gz:
Publisher:
publish.yml on AAGandomi/sphinxcontrib-archware
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinxcontrib_archware-0.0.1.tar.gz -
Subject digest:
8a205c68d1346e68f6b03769b8a8b7b70f37d4a04d5feb26ffe0161cbc5b498f - Sigstore transparency entry: 1103608850
- Sigstore integration time:
-
Permalink:
AAGandomi/sphinxcontrib-archware@1481805d41a0a637dfde005517480ba56223949a -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/AAGandomi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1481805d41a0a637dfde005517480ba56223949a -
Trigger Event:
push
-
Statement type:
File details
Details for the file sphinxcontrib_archware-0.0.1-py3-none-any.whl.
File metadata
- Download URL: sphinxcontrib_archware-0.0.1-py3-none-any.whl
- Upload date:
- Size: 19.5 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 |
fd456f8cff8ff81a08415b9d3fb6ae4d376ca08780c714d1ab45bba89edc676a
|
|
| MD5 |
a0329544c0b252a0c5d0d56034470a66
|
|
| BLAKE2b-256 |
c96239f5304a09c89f4bdea5fa9408480126baa326b308f9cf15b5feae69eae2
|
Provenance
The following attestation bundles were made for sphinxcontrib_archware-0.0.1-py3-none-any.whl:
Publisher:
publish.yml on AAGandomi/sphinxcontrib-archware
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinxcontrib_archware-0.0.1-py3-none-any.whl -
Subject digest:
fd456f8cff8ff81a08415b9d3fb6ae4d376ca08780c714d1ab45bba89edc676a - Sigstore transparency entry: 1103608911
- Sigstore integration time:
-
Permalink:
AAGandomi/sphinxcontrib-archware@1481805d41a0a637dfde005517480ba56223949a -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/AAGandomi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1481805d41a0a637dfde005517480ba56223949a -
Trigger Event:
push
-
Statement type: