Sphinx-needs-data-explorer is a Sphinx extension to visualize Sphinx-Needs data
Project description
Sphinx Needs Data Explorer
The sphinx_needs_data_explorer is a web application built with HTML, CSS, and JavaScript, offered as a Sphinx extension. Created as a personal open-source project, it enhances the interactivity of Sphinx-generated documentation by enabling users to explore the needs.json data produced by the Sphinx-Needs extension. Users can filter data attributes and view the data in three distinct modes: network-view, table-view , and file-view. Additionally, it supports generating reports in various formats, making it a powerful and flexible tool for analyzing and presenting documentation data.
Goals and Realization
Features
Three Sphinx-Needs Data View Perspectives
Network-View
In Network-View-Perspective you can see how sphinx-needs data are interconnected in data networks.
You can choose which data context to see - incoming connections from in-neighbours - outgoing connections from out-neighbours - incoming and outgoing connections
You can choose network layout - hierarchical bottom-up - hierarchical right-to-left - hierarchical with repulsion
Table-View
In Table-View-Perspective you can see sphinx-needs data in table. You can select which columns should be visible and which hidden.
File-View
In File-View-Perspective, you can see a list of files in which Sphinx-needs data were found.
Powerfull Interactive Data Filtering
You can predefine filtering expressions during documentation generation or interactively while browsing documentation, and apply the data filtering across all three view perspectives.
You can use attribute lookup table while writing your filters.
Exploring In-Neighbours, Out-Neighbours or both
Visualizing Constraint Violations in Network Transitions
Controlling Neighborhood Depth in Network Visualization
Switching between Perspective Views and Documentation
Interaction
Installation
You can install sphinx-needs-data-explorer with pip
pip install sphinx-needs-data-explorer
Alternatively (Linux)
git clone https://github.com/mi-parkes/sphinx-needs-data-explorer.git
cd sphinx-needs-data-explorer
poetry install
poetry build
poetry run task doc
# you can then install the package in your virtual environment
pip install dist/sphinx_needs_data_explorer*.whl
Activation
In your conf.py configuration file, add sphinx_needs_data_explorer to your extensions list. And, please, make sure that sphinx_needs extension is configured to generate needs.json file in the root of your documentation E.g.:
extensions = [
...
'sphinx_needs_data_explorer'
...
]
...
needs_build_json = True
or you can include it only if the extension is available in your virtual environment:
...
try:
import sphinx_needs_data_explorer
extensions.add('sphinx_needs_data_explorer')
except ImportError:
pass
...
needs_build_json = True
If your project uses sphinx_book_theme, sphinx_needs_data_explorer supports full integration in your documentation by adding E header button accesible from any documentation page.
Otherwise, you can create hyperlink to sphinx_needs_data_explorer by adding the following role in your .rst file(s)
:sphinx_needs_data_explorer:`Sphinx Needs Data Explorer Test`
Configuration
If defined, the following parameters are used for configuration:
needs_extra_options - the parameter defines extra sphinx-needs options
needs_extra_links - the parameter defines the type links to use when extracting sphinx-needs linkage
needs_types - the parameter defines sphinx-needs types and their attributes like node colors
You can predefine filtering expressions to populate the filter drop-down list:
sphinx_needs_data_explorer_config = {
"filters":[
"status=='open'",
"['15','16'] in id",
"title ~ /r.*[0-9]+5'$/i",
"type != 'req' && incoming==[]",
"type=='spec' && outgoing!=[] && title ~ /5'$/"
]
}
sphinx_needs_data_explorer Help lists all attributes found in your project that can be used for data filtering.
Visualizing Constraint Violations in Network Transitions:
sphinx_needs_data_explorer_config = {
"valid-linkage-color":"Black",
"invalid-linkage-color":"OrangeRed",
"valid-linkage":{
'need': {
'need':'refinement'
},
'feat': {
'feat':'refinement',
'need':'links'
},
...
}
}
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
File details
Details for the file sphinx_needs_data_explorer-0.9.5.tar.gz
.
File metadata
- Download URL: sphinx_needs_data_explorer-0.9.5.tar.gz
- Upload date:
- Size: 755.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.6 Darwin/22.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0b2c3bd3a4dad78f37ae7ce093adef8093e9303b7f407ac82ce8518be91bc99 |
|
MD5 | 7d1b80db79aeeeecb206baa7f01100f1 |
|
BLAKE2b-256 | 98c1a533e30fb1032d89cc309cff701b4c2a3be5b139e71077451c2b674ccf4f |
File details
Details for the file sphinx_needs_data_explorer-0.9.5-py3-none-any.whl
.
File metadata
- Download URL: sphinx_needs_data_explorer-0.9.5-py3-none-any.whl
- Upload date:
- Size: 763.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.6 Darwin/22.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24f11ff4eed28512a80a120335a9d4fac2312ca7ae064fbbc1186a230582ccfa |
|
MD5 | 382ce183bd7e06dacfd25f067072d271 |
|
BLAKE2b-256 | b2231bacc7a141a2f821595f2e698f2cdeabcf95231a2a65d272108b826b8e83 |