Skip to content

Commit

Permalink
Use Paracelsus to graph the database schema
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <[email protected]>
  • Loading branch information
abompard committed Jul 12, 2024
1 parent 1fcac2d commit e6eb3be
Show file tree
Hide file tree
Showing 6 changed files with 444 additions and 3 deletions.
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,16 @@ repos:
rev: v0.5.0
hooks:
- id: ruff

- repo: local
hooks:
- id: database-graph
name: Update the database schema graph
language: python
additional_dependencies: [paracelsus, sqlalchemy-helpers]
entry: paracelsus
args: [inject, doc/database_schema.md, "mirrormanager2.lib.model:BASE"]
files: mirrormanager2/lib/model\.py
require_serial: true
pass_filenames: false
verbose: true
20 changes: 18 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,19 @@

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ["sphinx.ext.autodoc", "sphinx.ext.coverage", "sphinx.ext.viewcode"]
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.coverage",
"sphinx.ext.viewcode",
"myst_parser",
"sphinxcontrib.mermaid",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# The suffix of source filenames.
source_suffix = ".rst"
source_suffix = {".rst": "restructuredtext", ".md": "markdown"}

# The encoding of source files.
# source_encoding = 'utf-8-sig'
Expand Down Expand Up @@ -87,6 +93,16 @@
# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []

# -- Extensions configuration ------

mermaid_d3_zoom = True

myst_enable_extensions = [
"colon_fence",
]
myst_heading_anchors = 3
myst_fence_as_directive = ["mermaid"]


# -- Options for HTML output ----------------------------------------------

Expand Down
Loading

0 comments on commit e6eb3be

Please sign in to comment.