sphinxcontrib-bitfield


Namesphinxcontrib-bitfield JSON
Version 2.0.0 PyPI version JSON
download
home_pagehttps://github.com/Arth-ur/sphinxcontrib-bitfield
SummarySphinx "bitfield" extension
upload_time2025-01-23 13:43:47
maintainerNone
docs_urlNone
authorArthur Gay
requires_pythonNone
licenseBSD
keywords sphinx extension documentation bitfield bytefield diagram renderer svg
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            sphinxcontrib-bitfield
======================

A `Sphinx <https://www.sphinx-doc.org/en/master/>`_ extension to generate bit field diagrams with
the `bit_field <https://github.com/Arth-ur/bitfield>`_ 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 }
            ]

.. image:: 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
    caption:
        String caption for the bitfield. If specified, the bitfield will be rendered as a figure

For more details, see the `bit_field <https://github.com/Arth-ur/bitfield>`_ package.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Arth-ur/sphinxcontrib-bitfield",
    "name": "sphinxcontrib-bitfield",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "sphinx, extension, documentation, bitfield, bytefield, diagram, renderer, svg",
    "author": "Arthur Gay",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/67/fe/baf861da52bd5b7374fda1e62d8b104098a636a3f2ff55466a62cadf940f/sphinxcontrib_bitfield-2.0.0.tar.gz",
    "platform": null,
    "description": "sphinxcontrib-bitfield\n======================\n\nA `Sphinx <https://www.sphinx-doc.org/en/master/>`_ extension to generate bit field diagrams with\nthe `bit_field <https://github.com/Arth-ur/bitfield>`_ Python package.\n\nInstallation\n------------\n\n::\n\n    pip install sphinxcontrib-bitfield\n\n\nEnable Extension\n-----------------\n\nAdd `sphinxcontrib.bitfield` in `extensions` of `conf.py`::\n\n    extensions = ['sphinxcontrib.bitfield']\n\n\nTo enable output with LaTeX support, add an image converter from SVG to PNG:\n\n::\n\n    extensions = ['sphinx.ext.imgconverter', 'sphinxcontrib.bitfield']\n\n\nUsage\n-----\nUse directive `bitfield` with the description of the bitfield in JSON format::\n\n    .. bitfield::\n        :bits: 32\n        :lanes: 2\n\n            [\n                { \"name\": \"IPO\",   \"bits\": 8, \"attr\": \"RO\" },\n                {                  \"bits\": 7 },\n                { \"name\": \"BRK\",   \"bits\": 5, \"attr\": \"RW\", \"type\": 4 },\n                { \"name\": \"CPK\",   \"bits\": 1 },\n                { \"name\": \"Clear\", \"bits\": 3 },\n                { \"bits\": 8 }\n            ]\n\n.. image:: https://raw.githubusercontent.com/Arth-ur/bitfield/master/bit_field/test/alpha.svg?sanitize=true\n\nThe `bitfield` directive accepts the following options:\n    vspace:\n        vertical space - default 80\n    hspace:\n        horizontal space - default 640\n    lanes:\n        rectangle lanes - default 2\n    bits:\n        overall bitwidth - default 32\n    fontfamily:\n        default sans-serif\n    fontweight:\n        default normal\n    fontsize:\n        default 14\n    strokewidth:\n        default 1\n    compact:\n        compact rendering mode\n    hflip:\n        horizontal flip\n    vflip:\n        vertical flip\n    uneven:\n        uneven lanes\n    trim:\n        trim long bitfield names, must provide the horizontal space available for a single character\n    legend:\n        space separated list of name and type optionally enclosed in quotes\n    caption:\n        String caption for the bitfield. If specified, the bitfield will be rendered as a figure\n\nFor more details, see the `bit_field <https://github.com/Arth-ur/bitfield>`_ package.\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Sphinx \"bitfield\" extension",
    "version": "2.0.0",
    "project_urls": {
        "Homepage": "https://github.com/Arth-ur/sphinxcontrib-bitfield"
    },
    "split_keywords": [
        "sphinx",
        " extension",
        " documentation",
        " bitfield",
        " bytefield",
        " diagram",
        " renderer",
        " svg"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9452bc44526f95d3a9b52f44f386da2d264c17dcc70c841b5ddc42567fe94b82",
                "md5": "02982fba53247dd06c85d01b150a4a3f",
                "sha256": "9189c375281ed4fbbcb9770d908275d0a5961382c1d1da1176b5b518e71a4db1"
            },
            "downloads": -1,
            "filename": "sphinxcontrib_bitfield-2.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "02982fba53247dd06c85d01b150a4a3f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4106,
            "upload_time": "2025-01-23T13:43:46",
            "upload_time_iso_8601": "2025-01-23T13:43:46.551589Z",
            "url": "https://files.pythonhosted.org/packages/94/52/bc44526f95d3a9b52f44f386da2d264c17dcc70c841b5ddc42567fe94b82/sphinxcontrib_bitfield-2.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "67febaf861da52bd5b7374fda1e62d8b104098a636a3f2ff55466a62cadf940f",
                "md5": "366b11016b94fa0e99e0533c5555412a",
                "sha256": "425011aab8234182aad84877092c76599ba4aa04aab0ed530e3ae19655c594a6"
            },
            "downloads": -1,
            "filename": "sphinxcontrib_bitfield-2.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "366b11016b94fa0e99e0533c5555412a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3511,
            "upload_time": "2025-01-23T13:43:47",
            "upload_time_iso_8601": "2025-01-23T13:43:47.990104Z",
            "url": "https://files.pythonhosted.org/packages/67/fe/baf861da52bd5b7374fda1e62d8b104098a636a3f2ff55466a62cadf940f/sphinxcontrib_bitfield-2.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-23 13:43:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Arth-ur",
    "github_project": "sphinxcontrib-bitfield",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "sphinxcontrib-bitfield"
}
        
Elapsed time: 0.42073s