From 2da9f717b2a662ae3a2adf7d51131833d6421da1 Mon Sep 17 00:00:00 2001 From: Lewis Middleton <66401219+lewismiddleton@users.noreply.github.com> Date: Wed, 3 Apr 2024 07:35:22 +0000 Subject: [PATCH 1/4] add mermaid2 plugin Adds the [mermaid2 plugin] (https://github.com/fralau/mkdocs-mermaid2-plugin) which enables mkdocs to render mermaid diagrams. --- mkdocs.yml | 9 +++++- poetry.lock | 80 +++++++++++++++++++++++++++++++++++++++++++++++++- pyproject.toml | 1 + 3 files changed, 88 insertions(+), 2 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index 2dc08336..2c4edcec 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -48,6 +48,9 @@ nav: - Testing: development/testing.md - Workflows: development/workflows.md +plugins: + - mermaid2 + markdown_extensions: - pymdownx.highlight: anchor_linenums: true @@ -56,7 +59,11 @@ markdown_extensions: emoji_generator: !!python/name:materialx.emoji.to_svg - pymdownx.inlinehilite - pymdownx.snippets - - pymdownx.superfences + - pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:mermaid2.fence_mermaid_custom - tables - attr_list - md_in_html diff --git a/poetry.lock b/poetry.lock index 94577275..fee4136d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -77,6 +77,27 @@ files = [ [package.extras] dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] +[[package]] +name = "beautifulsoup4" +version = "4.12.3" +description = "Screen-scraping library" +optional = false +python-versions = ">=3.6.0" +files = [ + {file = "beautifulsoup4-4.12.3-py3-none-any.whl", hash = "sha256:b80878c9f40111313e55da8ba20bdba06d8fa3969fc68304167741bbf9e082ed"}, + {file = "beautifulsoup4-4.12.3.tar.gz", hash = "sha256:74e3d1928edc070d21748185c46e3fb33490f22f52a3addee9aee0f4f7781051"}, +] + +[package.dependencies] +soupsieve = ">1.2" + +[package.extras] +cchardet = ["cchardet"] +chardet = ["chardet"] +charset-normalizer = ["charset-normalizer"] +html5lib = ["html5lib"] +lxml = ["lxml"] + [[package]] name = "black" version = "24.3.0" @@ -962,6 +983,16 @@ urllib3 = ">=1.26.0" ssh = ["paramiko (>=2.4.3)"] websockets = ["websocket-client (>=1.3.0)"] +[[package]] +name = "editorconfig" +version = "0.12.4" +description = "EditorConfig File Locator and Interpreter for Python" +optional = false +python-versions = "*" +files = [ + {file = "EditorConfig-0.12.4.tar.gz", hash = "sha256:24857fa1793917dd9ccf0c7810a07e05404ce9b823521c7dce22a4fb5d125f80"}, +] + [[package]] name = "fastapi" version = "0.110.0" @@ -1529,6 +1560,20 @@ files = [ {file = "jmespath-1.0.1.tar.gz", hash = "sha256:90261b206d6defd58fdd5e85f478bf633a2901798906be2ad389150c5c60edbe"}, ] +[[package]] +name = "jsbeautifier" +version = "1.15.1" +description = "JavaScript unobfuscator and beautifier." +optional = false +python-versions = "*" +files = [ + {file = "jsbeautifier-1.15.1.tar.gz", hash = "sha256:ebd733b560704c602d744eafc839db60a1ee9326e30a2a80c4adb8718adc1b24"}, +] + +[package.dependencies] +editorconfig = ">=0.12.2" +six = ">=1.13.0" + [[package]] name = "jsonschema" version = "4.19.1" @@ -1729,6 +1774,28 @@ files = [ {file = "mkdocs_material_extensions-1.3.tar.gz", hash = "sha256:f0446091503acb110a7cab9349cbc90eeac51b58d1caa92a704a81ca1e24ddbd"}, ] +[[package]] +name = "mkdocs-mermaid2-plugin" +version = "1.1.1" +description = "A MkDocs plugin for including mermaid graphs in markdown sources" +optional = false +python-versions = ">=3.6" +files = [ + {file = "mkdocs-mermaid2-plugin-1.1.1.tar.gz", hash = "sha256:bea5f3cbe6cb76bad21b81e49a01e074427ed466666c5d404e62fe8698bc2d7c"}, + {file = "mkdocs_mermaid2_plugin-1.1.1-py3-none-any.whl", hash = "sha256:4e25876b59d1e151ca33a467207b346404b4a246f4f24af5e44c32408e175882"}, +] + +[package.dependencies] +beautifulsoup4 = ">=4.6.3" +jsbeautifier = "*" +mkdocs = ">=1.0.4" +pymdown-extensions = ">=8.0" +requests = "*" +setuptools = ">=18.5" + +[package.extras] +test = ["mkdocs-material"] + [[package]] name = "more-itertools" version = "9.1.0" @@ -2644,6 +2711,17 @@ files = [ {file = "sortedcontainers-2.4.0.tar.gz", hash = "sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88"}, ] +[[package]] +name = "soupsieve" +version = "2.5" +description = "A modern CSS selector implementation for Beautiful Soup." +optional = false +python-versions = ">=3.8" +files = [ + {file = "soupsieve-2.5-py3-none-any.whl", hash = "sha256:eaa337ff55a1579b6549dc679565eac1e3d000563bcb1c8ab0d0fefbc0c2cdc7"}, + {file = "soupsieve-2.5.tar.gz", hash = "sha256:5663d5a7b3bfaeee0bc4372e7fc48f9cff4940b3eec54a6451cc5299f1097690"}, +] + [[package]] name = "starlette" version = "0.36.3" @@ -3057,4 +3135,4 @@ dev = ["doc8", "flake8", "flake8-import-order", "rstcheck[sphinx]", "sphinx"] [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "b3a9748ab97f9b17824300a04d5a348c0aa38be6be621a714701ea104200a3b8" +content-hash = "7ca017a2df5fdb46738f1b0fb4f38c1d85f5e8bf186733fc38b37f7be9008d29" diff --git a/pyproject.toml b/pyproject.toml index f64f5de4..4dff7ee3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,6 +32,7 @@ optional = true [tool.poetry.group.docs.dependencies] mkdocs-material = "^9.5.15" mkdocs = "^1.5.3" +mkdocs-mermaid2-plugin = "^1.1.1" [tool.poetry.group.dev.dependencies] connexion = "^3.0.5" From 8a0625590d895e67f638415bb9508ff1a611ad68 Mon Sep 17 00:00:00 2001 From: Lewis Middleton <66401219+lewismiddleton@users.noreply.github.com> Date: Wed, 3 Apr 2024 08:43:56 +0100 Subject: [PATCH 2/4] trunk fmt --- mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index 2c4edcec..bc637e7d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -48,7 +48,7 @@ nav: - Testing: development/testing.md - Workflows: development/workflows.md -plugins: +plugins: - mermaid2 markdown_extensions: From 4cf0a1bf6a82f64bfa99def98028da47ed3bca47 Mon Sep 17 00:00:00 2001 From: Lewis Middleton <66401219+lewismiddleton@users.noreply.github.com> Date: Mon, 8 Apr 2024 18:56:45 +0100 Subject: [PATCH 3/4] Revert "add mermaid2 plugin" This reverts commit 2da9f717b2a662ae3a2adf7d51131833d6421da1. This reverts commit 8a0625590d895e67f638415bb9508ff1a611ad68. --- mkdocs.yml | 9 +----- poetry.lock | 80 +------------------------------------------------- pyproject.toml | 1 - 3 files changed, 2 insertions(+), 88 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index bc637e7d..2dc08336 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -48,9 +48,6 @@ nav: - Testing: development/testing.md - Workflows: development/workflows.md -plugins: - - mermaid2 - markdown_extensions: - pymdownx.highlight: anchor_linenums: true @@ -59,11 +56,7 @@ markdown_extensions: emoji_generator: !!python/name:materialx.emoji.to_svg - pymdownx.inlinehilite - pymdownx.snippets - - pymdownx.superfences: - custom_fences: - - name: mermaid - class: mermaid - format: !!python/name:mermaid2.fence_mermaid_custom + - pymdownx.superfences - tables - attr_list - md_in_html diff --git a/poetry.lock b/poetry.lock index fee4136d..94577275 100644 --- a/poetry.lock +++ b/poetry.lock @@ -77,27 +77,6 @@ files = [ [package.extras] dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] -[[package]] -name = "beautifulsoup4" -version = "4.12.3" -description = "Screen-scraping library" -optional = false -python-versions = ">=3.6.0" -files = [ - {file = "beautifulsoup4-4.12.3-py3-none-any.whl", hash = "sha256:b80878c9f40111313e55da8ba20bdba06d8fa3969fc68304167741bbf9e082ed"}, - {file = "beautifulsoup4-4.12.3.tar.gz", hash = "sha256:74e3d1928edc070d21748185c46e3fb33490f22f52a3addee9aee0f4f7781051"}, -] - -[package.dependencies] -soupsieve = ">1.2" - -[package.extras] -cchardet = ["cchardet"] -chardet = ["chardet"] -charset-normalizer = ["charset-normalizer"] -html5lib = ["html5lib"] -lxml = ["lxml"] - [[package]] name = "black" version = "24.3.0" @@ -983,16 +962,6 @@ urllib3 = ">=1.26.0" ssh = ["paramiko (>=2.4.3)"] websockets = ["websocket-client (>=1.3.0)"] -[[package]] -name = "editorconfig" -version = "0.12.4" -description = "EditorConfig File Locator and Interpreter for Python" -optional = false -python-versions = "*" -files = [ - {file = "EditorConfig-0.12.4.tar.gz", hash = "sha256:24857fa1793917dd9ccf0c7810a07e05404ce9b823521c7dce22a4fb5d125f80"}, -] - [[package]] name = "fastapi" version = "0.110.0" @@ -1560,20 +1529,6 @@ files = [ {file = "jmespath-1.0.1.tar.gz", hash = "sha256:90261b206d6defd58fdd5e85f478bf633a2901798906be2ad389150c5c60edbe"}, ] -[[package]] -name = "jsbeautifier" -version = "1.15.1" -description = "JavaScript unobfuscator and beautifier." -optional = false -python-versions = "*" -files = [ - {file = "jsbeautifier-1.15.1.tar.gz", hash = "sha256:ebd733b560704c602d744eafc839db60a1ee9326e30a2a80c4adb8718adc1b24"}, -] - -[package.dependencies] -editorconfig = ">=0.12.2" -six = ">=1.13.0" - [[package]] name = "jsonschema" version = "4.19.1" @@ -1774,28 +1729,6 @@ files = [ {file = "mkdocs_material_extensions-1.3.tar.gz", hash = "sha256:f0446091503acb110a7cab9349cbc90eeac51b58d1caa92a704a81ca1e24ddbd"}, ] -[[package]] -name = "mkdocs-mermaid2-plugin" -version = "1.1.1" -description = "A MkDocs plugin for including mermaid graphs in markdown sources" -optional = false -python-versions = ">=3.6" -files = [ - {file = "mkdocs-mermaid2-plugin-1.1.1.tar.gz", hash = "sha256:bea5f3cbe6cb76bad21b81e49a01e074427ed466666c5d404e62fe8698bc2d7c"}, - {file = "mkdocs_mermaid2_plugin-1.1.1-py3-none-any.whl", hash = "sha256:4e25876b59d1e151ca33a467207b346404b4a246f4f24af5e44c32408e175882"}, -] - -[package.dependencies] -beautifulsoup4 = ">=4.6.3" -jsbeautifier = "*" -mkdocs = ">=1.0.4" -pymdown-extensions = ">=8.0" -requests = "*" -setuptools = ">=18.5" - -[package.extras] -test = ["mkdocs-material"] - [[package]] name = "more-itertools" version = "9.1.0" @@ -2711,17 +2644,6 @@ files = [ {file = "sortedcontainers-2.4.0.tar.gz", hash = "sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88"}, ] -[[package]] -name = "soupsieve" -version = "2.5" -description = "A modern CSS selector implementation for Beautiful Soup." -optional = false -python-versions = ">=3.8" -files = [ - {file = "soupsieve-2.5-py3-none-any.whl", hash = "sha256:eaa337ff55a1579b6549dc679565eac1e3d000563bcb1c8ab0d0fefbc0c2cdc7"}, - {file = "soupsieve-2.5.tar.gz", hash = "sha256:5663d5a7b3bfaeee0bc4372e7fc48f9cff4940b3eec54a6451cc5299f1097690"}, -] - [[package]] name = "starlette" version = "0.36.3" @@ -3135,4 +3057,4 @@ dev = ["doc8", "flake8", "flake8-import-order", "rstcheck[sphinx]", "sphinx"] [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "7ca017a2df5fdb46738f1b0fb4f38c1d85f5e8bf186733fc38b37f7be9008d29" +content-hash = "b3a9748ab97f9b17824300a04d5a348c0aa38be6be621a714701ea104200a3b8" diff --git a/pyproject.toml b/pyproject.toml index 4dff7ee3..f64f5de4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,6 @@ optional = true [tool.poetry.group.docs.dependencies] mkdocs-material = "^9.5.15" mkdocs = "^1.5.3" -mkdocs-mermaid2-plugin = "^1.1.1" [tool.poetry.group.dev.dependencies] connexion = "^3.0.5" From 868e31055f179c56afa7209ff0eb352a0e881053 Mon Sep 17 00:00:00 2001 From: Lewis Middleton <66401219+lewismiddleton@users.noreply.github.com> Date: Mon, 8 Apr 2024 18:58:19 +0100 Subject: [PATCH 4/4] superfences fence_code_format --- mkdocs.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index 2dc08336..b641804d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -56,7 +56,11 @@ markdown_extensions: emoji_generator: !!python/name:materialx.emoji.to_svg - pymdownx.inlinehilite - pymdownx.snippets - - pymdownx.superfences + - pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format - tables - attr_list - md_in_html