Sphinx Data Viewer is a Sphinx extension that provides an interactive list view for presenting JSON and Python data within your documentation. It allows users to display structured data directly from inline content, JSON files, or Python objects. The library is currently at version 0.1.5, released on August 28, 2024, and maintains an active development cadence tied to Sphinx compatibility.
pip install sphinx-data-viewerVerified import paths — ran on the pinned version, not inferred.
To get started with Sphinx Data Viewer, first install the package. Then, enable the extension by adding 'sphinx_data_viewer' to the `extensions` list in your Sphinx project's `conf.py` file. Finally, use the `.. data-viewer::` reStructuredText directive in your documentation files to display inline JSON, content from a JSON file, or data from a Python variable defined in `conf.py`. The `:expand:` option can be used to show the complete data by default.
Upgrade to sphinx-data-viewer version 0.1.5 or newer: `pip install --upgrade sphinx-data-viewer`.
Simply include `:expand:` without any value to enable it, like this: `.. data-viewer:: :expand: { ... }`.