Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(domain): Add diagram of entities for each domain context
Abstract ======== In the specifications part of the documentation, on each context, add a diagram representing all entities with their relations Motivation ========== Having a "big picture" of each domain context is a great addition to the detailed specifications. It's important for such things to be generated from the code, to avoid the classical problem of out of sync documentation. Rationale ========= There are many steps: - import all python files to get all the subclasses of `BaseModel`, thanks to `pkgutil.wal_packages` and `importlib.import_module` - iterate over all the subclasses of `BaseModel` to get the final ones, ie the ones without any subclasses - find all contexts, assuming all contexts are directly at the root of the `isshub.domain.contexts` package, thanks to `pgkutil.iter_modules` - introspect model fields thanks to `typing.get_type_hints` and the `metadata` attribute of `attr` to get the name of relations (in python 3.9 we'll be able to use the `Annotated` type for that) - manually create `.dot` files - in the doc building process, create all these dot files and use the `graphviz` sphinx plugin to automatically render the diagrams - insert the diagrams at the top of each context specification index page
- Loading branch information