Sphinx "bitfield" extension
Project description
A Sphinx extension to generate bit field diagrams with the bit_field Python package.
Installation
pip install sphinxcontrib-bitfield
Enable Extension
Add sphinxcontrib.bitfield in extensions of conf.py:
extensions = ['sphinxcontrib.bitfield']
To enable output with LaTeX support, add an image converter from SVG to PNG:
extensions = ['sphinx.ext.imgconverter', 'sphinxcontrib.bitfield']
Usage
Use directive bitfield with the description of the bitfield in JSON format:
.. bitfield:: :bits: 32 :lanes: 2 [ { "name": "IPO", "bits": 8, "attr": "RO" }, { "bits": 7 }, { "name": "BRK", "bits": 5, "attr": "RW", "type": 4 }, { "name": "CPK", "bits": 1 }, { "name": "Clear", "bits": 3 }, { "bits": 8 } ]
- The bitfield directive accepts the following options:
- vspace:
vertical space - default 80
- hspace:
horizontal space - default 640
- lanes:
rectangle lanes - default 2
- bits:
overall bitwidth - default 32
- fontfamily:
default sans-serif
- fontweight:
default normal
- fontsize:
default 14
- strokewidth:
default 1
- compact:
compact rendering mode
- hflip:
horizontal flip
- vflip:
vertical flip
- uneven:
uneven lanes
- trim:
trim long bitfield names, must provide the horizontal space available for a single character
- legend:
space separated list of name and type optionally enclosed in quotes
- caption:
String caption for the bitfield. If specified, the bitfield will be rendered as a figure
For more details, see the bit_field package.
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
Built Distribution
File details
Details for the file sphinxcontrib_bitfield-2.0.0.tar.gz
.
File metadata
- Download URL: sphinxcontrib_bitfield-2.0.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
425011aab8234182aad84877092c76599ba4aa04aab0ed530e3ae19655c594a6
|
|
MD5 |
366b11016b94fa0e99e0533c5555412a
|
|
BLAKE2b-256 |
67febaf861da52bd5b7374fda1e62d8b104098a636a3f2ff55466a62cadf940f
|
File details
Details for the file sphinxcontrib_bitfield-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: sphinxcontrib_bitfield-2.0.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
9189c375281ed4fbbcb9770d908275d0a5961382c1d1da1176b5b518e71a4db1
|
|
MD5 |
02982fba53247dd06c85d01b150a4a3f
|
|
BLAKE2b-256 |
9452bc44526f95d3a9b52f44f386da2d264c17dcc70c841b5ddc42567fe94b82
|