Skip to main content

Sphinx "bitfield" extension

Project description

A Sphinx extension to generate bit field diagrams with the bit_field Python package.

Installation

pip install sphinxcontrib-bitfield

To install with LaTeX support:

pip install sphinxcontrib-bitfield[LaTeX]

Enable Extension

Add sphinxcontrib.bitfield in extensions of conf.py:

extensions = ['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 }
        ]
https://raw.githubusercontent.com/Arth-ur/bitfield/master/bit_field/test/alpha.svg?sanitize=true
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

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

sphinxcontrib-bitfield-1.0.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

sphinxcontrib_bitfield-1.0.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file sphinxcontrib-bitfield-1.0.0.tar.gz.

File metadata

File hashes

Hashes for sphinxcontrib-bitfield-1.0.0.tar.gz
Algorithm Hash digest
SHA256 308afb114377d0363f43428aff176371cb4246adaecce93de82a6dd872041f62
MD5 22360a24f280c9dfb9b77c463f2ab543
BLAKE2b-256 26fe039fce7015761fdc1f483bbbfd9112e9592737d523eca59493c4b328e9b0

See more details on using hashes here.

File details

Details for the file sphinxcontrib_bitfield-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinxcontrib_bitfield-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9f2e6bef121b1df98f87d3eefbd37c67c99d764b27d69674b99825ccb65060c2
MD5 3151611ad705573f99b2ad604bc44de7
BLAKE2b-256 a4a3798c560a7bb341d588f89e6a04d3b1fe3e6eef6fd2a2249914bfa5e00ae4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page