Metadata-Version: 2.4
Name: theoworks-sphinx
Version: 0.1.0
Summary: TheoWorks Sphinx extension — emits the needs-graph JSON (needs.json) consumed by the TheoWorks viewer, editor, and CLI
Author: TheoWorks
License-Expression: Apache-2.0
Project-URL: Homepage, https://theoworks.io
Project-URL: Source, https://gitlab.com/theoworks/theoworks
Keywords: sphinx,sphinx-needs,requirements,ASPICE,traceability
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Sphinx
Classifier: Framework :: Sphinx :: Extension
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Documentation :: Sphinx
Classifier: Topic :: Software Development :: Documentation
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: theoworks-core>=0.1.0
Requires-Dist: sphinx>=5.0
Requires-Dist: sphinx-needs>=2.0
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Dynamic: license-file

# theoworks-sphinx

The [TheoWorks](https://theoworks.io) Sphinx extension. It runs inside a
[sphinx-needs](https://sphinx-needs.readthedocs.io) build and emits the
**needs graph** (`needs.json`) consumed by the TheoWorks viewer, editor, and
[`theoworks-cli`](https://pypi.org/project/theoworks-cli/).

## Install

```bash
pip install theoworks-sphinx
```

This pulls in [`theoworks-core`](https://pypi.org/project/theoworks-core/),
`sphinx`, and `sphinx-needs`.

## Usage

Add the extension to your project's `conf.py` (after `sphinx_needs`):

```python
extensions = [
    "sphinx_needs",
    "theoworks_sphinx",
]
```

Build as usual; the extension writes the enriched needs graph alongside the
Sphinx output:

```bash
sphinx-build -b html docs docs/_build
```

You can also extract the graph directly from Python (no HTML build required):

```python
from theoworks_sphinx import extract_project, write_needs_graph

graph = extract_project("path/to/project")
write_needs_graph(graph, "needs-graph.json")
```

## License

Apache-2.0. See [LICENSE](LICENSE).
