{"id":15655270,"url":"https://github.com/zoni/mkdocs-diagrams","last_synced_at":"2025-05-04T05:40:05.126Z","repository":{"id":41444689,"uuid":"264415026","full_name":"zoni/mkdocs-diagrams","owner":"zoni","description":"MkDocs plugin to render Diagrams files","archived":false,"fork":false,"pushed_at":"2020-09-04T08:33:06.000Z","size":19,"stargazers_count":30,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T22:49:07.809Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zoni.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-16T10:44:25.000Z","updated_at":"2025-03-20T17:10:03.000Z","dependencies_parsed_at":"2022-08-01T00:07:58.427Z","dependency_job_id":null,"html_url":"https://github.com/zoni/mkdocs-diagrams","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoni%2Fmkdocs-diagrams","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoni%2Fmkdocs-diagrams/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoni%2Fmkdocs-diagrams/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoni%2Fmkdocs-diagrams/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoni","download_url":"https://codeload.github.com/zoni/mkdocs-diagrams/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252133860,"owners_count":21699619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T12:57:32.875Z","updated_at":"2025-05-03T02:32:44.027Z","avatar_url":"https://github.com/zoni.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mkdocs-diagrams\n\nA plugin for the [MkDocs] documentation site generator which facilitates easy embedding of system architecture diagrams through the [Diagrams] project ([view examples]).\n\n## Installation\n\n`mkdocs-diagrams` is available on PyPI.\nIt can be installed through `pip install mkdocs-diagrams` or equivalent command with pipenv or poetry.\n\nYou'll also need to have the [graphviz] `dot` tool installed on your system.\nIt's available as `graphviz` in most package managers.\n\nOnce installed, configure MkDocs to use this plugin by including `diagrams` in the `plugins` list in your `mkdocs.yml`.\nFor example:\n\n```yaml\nplugins:\n  - diagrams\n  - search\n```\n\n(If you don't have a `plugins` key in your config yet, you'll almost surely want to include `search` as well.\nIt's a default plugin that will otherwise get deactivated.)\n\n## Usage\n\n\u003e **Warning:** This plugin will execute `.diagram.py` files during build, as that is how [Diagrams] itself operates.\n\u003e Be careful using this plugin with untrusted input as this effectively allows arbitrary code execution.\n\nOnce installed, the diagrams plugin can be used by including diagrams files in your docs directory.\n\nFor example, create a file named `example.diagrams.py` with the following contents:\n\n```python\nfrom diagrams import Cluster, Diagram\nfrom diagrams.aws.compute import ECS, EKS, Lambda\nfrom diagrams.aws.database import Redshift\nfrom diagrams.aws.integration import SQS\nfrom diagrams.aws.storage import S3\n\n\nwith Diagram(\"Event Processing\", show=False):\n    source = EKS(\"k8s source\")\n\n    with Cluster(\"Event Flows\"):\n        with Cluster(\"Event Workers\"):\n            workers = [ECS(\"worker1\"),\n                       ECS(\"worker2\"),\n                       ECS(\"worker3\")]\n\n        queue = SQS(\"event queue\")\n\n        with Cluster(\"Processing\"):\n            handlers = [Lambda(\"proc1\"),\n                        Lambda(\"proc2\"),\n                        Lambda(\"proc3\")]\n\n    store = S3(\"events store\")\n    dw = Redshift(\"analytics\")\n\n    source \u003e\u003e workers \u003e\u003e queue \u003e\u003e handlers\n    handlers \u003e\u003e store\n    handlers \u003e\u003e dw\n```\n\nWhen MkDocs is run (either with `build` or `serve`), this will result in a file named `event_processing.png` being created.\nInclude this in your markdown files using regular image syntax: `![Event processing architecture](event_processing.png)`\n\n## Configuration\n\nThis plugin supports a few config options, which can be set as follows:\n\n```yaml\nplugins:\n  - diagrams:\n      file_extension: \".diagrams.py\"\n      max_workers: 5\n```\n\n### `file_extension`\n\nSets the filename extension for diagram files.\nWhen `mkdocs build` or `mkdocs serve` is run, all files ending in this extension will be executed.\n\nDefault: `.diagrams.py`\n\n### `max_workers`\n\nA pool of workers is used to render diagram files in parallel on multi-core systems.\nSetting this allows you to limit the number of workers to this amount.\n\nDefault: Dynamically chosen (`os.cpu_count() + 2`)\n\n[diagrams]: https://diagrams.mingrammer.com/\n[graphviz]: https://www.graphviz.org/\n[mkdocs]: https://www.mkdocs.org/\n[view examples]: https://diagrams.mingrammer.com/docs/getting-started/examples\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoni%2Fmkdocs-diagrams","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoni%2Fmkdocs-diagrams","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoni%2Fmkdocs-diagrams/lists"}