Skip to content

Commit 9cd7a1f

Browse files
authored
Merge pull request #652 from maykinmedia/feature/datamodel-image
✨ [maykinmedia/open-api-framework#159] add model img docs creation
2 parents e407d5a + 66bd933 commit 9cd7a1f

File tree

14 files changed

+63
-12
lines changed

14 files changed

+63
-12
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ jobs:
141141
- store-reusable-workflow-vars
142142
with:
143143
main-branch: 'master'
144-
apt-packages: 'libgdal-dev gdal-bin'
144+
apt-packages: 'libgdal-dev gdal-bin graphviz graphviz-dev'
145145
run-docs: true
146146
django-settings-module: objects.conf.ci
147147
python-version: '3.12'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ __pycache__
1515

1616
# Generated files
1717
docs/_build
18+
/docs/_static/uml/*.png
1819
src/objects/static/bundles/
1920
/volumes/
2021

.readthedocs.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,15 @@ sphinx:
88
configuration: docs/conf.py
99

1010
build:
11-
os: 'ubuntu-22.04'
11+
os: "ubuntu-22.04"
1212
apt_packages:
1313
- libxml2-dev
1414
- libxmlsec1-dev
1515
- libxmlsec1-openssl
1616
- wget
1717
- libgdal-dev
1818
- gdal-bin
19+
- graphviz
20+
- graphviz-dev
1921
tools:
20-
python: '3.12'
21-
22-
python:
23-
install:
24-
- requirements: requirements/dev.txt
22+
python: "3.12"

docs/_static/uml/.gitkeep

Whitespace-only changes.

docs/conf.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
sys.path.insert(0, os.path.abspath("../src"))
1818

19+
1920
import objects # noqa isort:skip
2021
from objects.setup import setup_env # noqa isort:skip
2122

@@ -54,9 +55,11 @@
5455
"sphinx_tabs.tabs",
5556
"recommonmark",
5657
"sphinx.ext.autodoc",
58+
"sphinx.ext.graphviz",
5759
"django_setup_configuration.documentation.setup_config_example",
5860
"django_setup_configuration.documentation.setup_config_usage",
59-
# "sphinx_markdown_tables",
61+
"vng_api_common.diagrams.uml_images",
62+
"sphinx_markdown_tables",
6063
]
6164

6265
# Add any paths that contain templates here, relative to this directory.
@@ -80,6 +83,9 @@
8083

8184
source_suffix = [".rst", ".md"]
8285

86+
# Datamodel image settings
87+
graphviz_output_format = "png"
88+
8389
# -- Options for HTML output -------------------------------------------------
8490

8591
# The theme to use for HTML and HTML Help pages. See the documentation for
45.1 KB
Loading

docs/introduction/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ configuration or development needed.
2828
background
2929
definitions
3030
information-model
31+
uml-diagram
3132
metadata
3233
visualization
3334
features

docs/introduction/uml-diagram.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
UML Diagrams
2+
============
3+
4+
This section contains UML diagrams for resources per components.
5+
6+
.. note::
7+
8+
These are the underlying data models and this shows the relationships between the resources,
9+
but not all attributes are the exact same as in the API.
10+
11+
Objects API
12+
-----------
13+
.. uml_images::
14+
:apps: core
15+
:excluded_models: Service
16+
17+
18+
Objecttypes API
19+
---------------
20+
21+
Core
22+
23+
.. image:: _assets/img/objecttypes.png
24+
:width: 100%
25+
:alt: Objecttypes UML diagram.

requirements/base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ click-plugins==1.1.1
6060
# via celery
6161
click-repl==0.3.0
6262
# via celery
63-
commonground-api-common==2.7.0
63+
commonground-api-common==2.9.0
6464
# via
6565
# -r requirements/base.in
6666
# open-api-framework

requirements/ci.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ click-repl==0.3.0
111111
# celery
112112
codecov==2.1.13
113113
# via -r requirements/test-tools.in
114-
commonground-api-common==2.7.0
114+
commonground-api-common==2.9.0
115115
# via
116116
# -c requirements/base.txt
117117
# -r requirements/base.txt
@@ -434,6 +434,8 @@ kombu==5.5.4
434434
# celery
435435
lxml==4.9.4
436436
# via pyquery
437+
markdown==3.8.2
438+
# via sphinx-markdown-tables
437439
markupsafe==2.1.3
438440
# via jinja2
439441
maykin-2fa==1.0.1
@@ -672,6 +674,8 @@ sphinx==8.1.3
672674
# sphinx-rtd-theme
673675
# sphinx-tabs
674676
# sphinxcontrib-jquery
677+
sphinx-markdown-tables==0.0.17
678+
# via -r requirements/docs.in
675679
sphinx-rtd-theme==3.0.2
676680
# via -r requirements/docs.in
677681
sphinx-tabs==3.4.7

0 commit comments

Comments
 (0)