docs: replace svg with dot

This commit is contained in:
Evgenii Alekseev 2024-09-30 14:09:01 +03:00
parent 1e7d4daf18
commit 910d178c71
5 changed files with 1837 additions and 8 deletions

View File

@ -4,6 +4,8 @@ build:
os: ubuntu-20.04 os: ubuntu-20.04
tools: tools:
python: "3.12" python: "3.12"
apt_packages:
- graphviz
python: python:
install: install:

1820
docs/_static/architecture.dot vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -12,8 +12,7 @@ Packages have strict rules of importing:
Full dependency diagram: Full dependency diagram:
.. image:: _static/architecture.svg .. graphviz:: _static/architecture.dot
:target: _static/architecture.svg
:alt: architecture :alt: architecture
``ahriman.application`` package ``ahriman.application`` package

View File

@ -10,7 +10,7 @@
# add these directories to sys.path here. If the directory is relative to the # add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here. # documentation root, use os.path.abspath to make it absolute, like shown here.
# #
import os import datetime
import sys import sys
from pathlib import Path from pathlib import Path
@ -21,13 +21,11 @@ from ahriman import __version__
basedir = Path(__file__).resolve().parent.parent / "src" basedir = Path(__file__).resolve().parent.parent / "src"
sys.path.insert(0, str(basedir)) sys.path.insert(0, str(basedir))
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
# -- Project information ----------------------------------------------------- # -- Project information -----------------------------------------------------
project = "ahriman" project = "ahriman"
copyright = "2021-2023, ahriman team" copyright = f"2021-{datetime.date.today().year}, ahriman team"
author = "ahriman team" author = "ahriman team"
# The full version, including alpha/beta/rc tags # The full version, including alpha/beta/rc tags
@ -41,6 +39,7 @@ release = __version__
# ones. # ones.
extensions = [ extensions = [
"sphinx.ext.autodoc", "sphinx.ext.autodoc",
"sphinx.ext.graphviz",
"sphinx.ext.napoleon", "sphinx.ext.napoleon",
"sphinx_rtd_theme", "sphinx_rtd_theme",
"sphinxarg.ext", "sphinxarg.ext",
@ -78,7 +77,12 @@ html_logo = "_static/logo.svg"
add_module_names = False add_module_names = False
modindex_common_prefix = ["ahriman.application.", "ahriman.core.", "ahriman.models.", "ahriman.web."] modindex_common_prefix = [
"ahriman.application.",
"ahriman.core.",
"ahriman.models.",
"ahriman.web.",
]
# -- Extension configuration ------------------------------------------------- # -- Extension configuration -------------------------------------------------
@ -92,3 +96,5 @@ autodoc_mock_imports = ["cryptography", "pyalpm"]
autodoc_default_options = { autodoc_default_options = {
"no-undoc-members": True, "no-undoc-members": True,
} }
graphviz_output_format = "svg"

View File

@ -49,13 +49,15 @@ changedir = src
allowlist_externals = allowlist_externals =
bash bash
find find
mv
setenv = setenv =
SPHINX_APIDOC_OPTIONS=members,no-undoc-members,show-inheritance SPHINX_APIDOC_OPTIONS=members,no-undoc-members,show-inheritance
commands = commands =
bash -c 'shtab --shell bash --prefix ahriman --prog ahriman ahriman.application.ahriman._parser > ../package/share/bash-completion/completions/_ahriman' bash -c 'shtab --shell bash --prefix ahriman --prog ahriman ahriman.application.ahriman._parser > ../package/share/bash-completion/completions/_ahriman'
bash -c 'shtab --shell zsh --prefix ahriman --prog ahriman ahriman.application.ahriman._parser > ../package/share/zsh/site-functions/_ahriman' bash -c 'shtab --shell zsh --prefix ahriman --prog ahriman ahriman.application.ahriman._parser > ../package/share/zsh/site-functions/_ahriman'
argparse-manpage --module ahriman.application.ahriman --function _parser --author "ahriman team" --project-name ahriman --author-email "" --url https://github.com/arcan1s/ahriman --output ../package/share/man/man1/ahriman.1 argparse-manpage --module ahriman.application.ahriman --function _parser --author "ahriman team" --project-name ahriman --author-email "" --url https://github.com/arcan1s/ahriman --output ../package/share/man/man1/ahriman.1
pydeps ahriman -o ../docs/_static/architecture.svg --no-config --no-show --cluster pydeps ahriman --no-output --show-dot --dot-output architecture.dot --no-config --cluster
mv architecture.dot ../docs/_static/architecture.dot
# remove autogenerated modules rst files # remove autogenerated modules rst files
find ../docs -type f -name "{[tox]project_name}*.rst" -delete find ../docs -type f -name "{[tox]project_name}*.rst" -delete
sphinx-apidoc -o ../docs . sphinx-apidoc -o ../docs .