Metadata-Version: 2.3
Name: sphinx-diagram-connect
Version: 1.1.0
Summary: sphinx-diagram-connect is a Sphinx extension to resolve std:ref-s defined in plantuml files
License: MIT License
         
         Copyright (c) 2024 mi-parkes
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
Author: Michael Parkes
Author-email: mparkes@post.cz
Requires-Python: >=3.10,<4.0
Classifier: License :: Other/Proprietary License
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
Requires-Dist: lxml (>=5.4.0)
Requires-Dist: sphinx (>=6.1.3)
Description-Content-Type: text/markdown

# Enhance Your Sphinx Documentation with Dynamic Diagram Links

See the **[complete documentation rendered with Sphinx](https://mi-parkes.github.io/sphinx-diagram-connect/)** 📚.

## Unlock Seamless Navigation Between Diagrams and Documentation

`sphinx_diagram_connect` is a powerful [Sphinx](https://www.sphinx-doc.org/en/master/index.html) extension designed to create intelligent, clickable links within your [PlantUML](https://plantuml.com) or [DrawIO](https://pypi.org/project/sphinxcontrib-drawio/) diagrams.

* By automatically resolving `std:doc` or `std:ref` syntax, this extension allows you to effortlessly connect elements in your diagrams directly to relevant sections or components within your Sphinx documentation.

* Also references to other domain like `py:func` will be resolved.

* **Optionally**, references to`need` items can be resolved if the *sphinx-needs* package is available in the **Python environment** and the extension is enabled in the documentation project’s **conf.py**.

The **sphinx_diagram_connect** extension works on the generated *svg* files of your graphical tools. This means also other diagram types are supported automatically.

> This means enhanced navigation, improved information flow, and a more interactive experience for your readers!

### See It in Action: Dynamic References in PlantUML

Imagine clicking on a diagram element and being taken directly to its detailed explanation in your documentation. This is precisely what `sphinx_diagram_connect` enables.

![](https://mi-parkes.github.io/sphinx-diagram-connect/_images/refInPlantuml.png)

This example demonstrates how references of the standard domain `std` with `:doc:` and `:ref:` syntax within your PlantUML code becomes a live hyperlink in your rendered documentation:

```rst
.. uml::
    :caption: PlantUML Caption with **bold** and *italic*
    :name: PlantUML Label2

    @startmindmap mindmap2

    *[#Orange] Example of clickable references
    **[#lightgreen] [[ ":ref:`Heading 2`" Internal Page Arbitrary Reference1 ]]
    **[#lightblue] [[ ":ref:`N_00002`" Internal Page Arbitrary Reference2 on sphinx-needs ]]
    **[#lightgrey] [[ ":doc:`Test PlantUML 3`" Internal Page Reference3 ]]

    @endmindmap
```
## Installation

You can easily install [sphinx-diagram-connect](https://pypi.org/project/sphinx-diagram-connect/) using pip:

```bash
pip install sphinx-diagram-connect
```

Alternatively (for Linux users with Poetry):

```bash
git clone https://github.com/mi-parkes/sphinx-diagram-connect.git
cd sphinx-diagram-connect

poetry install
poetry build

poetry add -G sphinx dist/sphinx_diagram_connect-*-py3-none-any.whl
```

## Activation

Once installed, simply add `sphinx_diagram_connect` to your extensions list in your conf.py file:

```python
extensions = [
    ...,
    'sphinx_diagram_connect'
]
```

## Listing Available Labels:

To see all referenceable labels in your project, use:

```bash
poetry run task labels
```

