Skip to content

Commit ecad437

Browse files
sydney-runklemdrxy
authored andcommitted
feat: use new interactive HTML application for middleware (#853)
* Remove old images no longer being used * Add new images in an auto-generated JSON file * add widget to middleware page demoing new middleware :) * auto generated mermaid diagrams confirm correct graph structure for middleware implementation * js and python implementations 🚀 https://github.com/user-attachments/assets/ab7a47cf-6dd3-4bbb-aa16-73cd3c231bea Totally open to structural changes etc to this code, just wanted to get an initial example in
1 parent 9295ed1 commit ecad437

File tree

26 files changed

+750
-35
lines changed

26 files changed

+750
-35
lines changed

pipeline/core/builder.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def __init__(self, src_dir: Path, build_dir: Path) -> None:
5151
".yaml",
5252
".css",
5353
".js",
54+
".html",
5455
}
5556

5657
# Mapping of language codes to full names for URLs
@@ -156,8 +157,8 @@ def rewrite_link(match: re.Match) -> str:
156157
url = match.group(2) # The URL
157158
post = match.group(3) # Everything after the URL
158159

159-
# Only rewrite absolute /oss/ paths that don't contain 'images'
160-
if url.startswith("/oss/") and "images" not in url:
160+
# Only rewrite absolute /oss/ paths that don't contain 'images' or 'plugins'
161+
if url.startswith("/oss/") and "images" not in url and "plugins" not in url:
161162
parts = url.split("/")
162163
# Insert full language name after "oss"
163164
parts.insert(2, self.language_url_names[target_language])
@@ -743,8 +744,11 @@ def is_shared_file(self, file_path: Path) -> bool:
743744
if "snippets" in relative_path.parts:
744745
return True
745746

747+
if "plugins" in relative_path.parts:
748+
return True
749+
746750
# JavaScript and CSS files should be shared (used for custom scripts/styles)
747-
return file_path.suffix.lower() in {".js", ".css"}
751+
return file_path.suffix.lower() in {".js", ".css", ".html", ".json"}
748752

749753
def _copy_shared_files(self) -> None:
750754
"""Copy files that should be shared between versions."""

pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ asyncio_default_fixture_loop_scope = "function"
7070
line-length = 88
7171
extend-exclude = [
7272
"scripts/update_mdx.py",
73-
"pipeline/tools/notebook/convert.py"
73+
"pipeline/tools/notebook/convert.py",
74+
"src/plugins/middleware_visualization/generate_middleware_diagrams.py"
7475
]
7576

7677

@@ -133,3 +134,9 @@ ignore = [
133134

134135
[tool.ruff.lint.pydocstyle]
135136
convention = "google"
137+
138+
139+
[tool.mypy]
140+
exclude = [
141+
"src/plugins/middleware_visualization/generate_middleware_diagrams.py",
142+
]

src/oss/images/0000.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)