Skip to content

Commit 180db67

Browse files
Add Help Menu in NodeLibrarySidebarTab (#8179)
1 parent d062fcc commit 180db67

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

app/frontend_management.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,19 @@ def templates_path(cls) -> str:
205205
""".strip()
206206
)
207207

208+
@classmethod
209+
def embedded_docs_path(cls) -> str:
210+
"""Get the path to embedded documentation"""
211+
try:
212+
import comfyui_embedded_docs
213+
214+
return str(
215+
importlib.resources.files(comfyui_embedded_docs) / "docs"
216+
)
217+
except ImportError:
218+
logging.info("comfyui-embedded-docs package not found")
219+
return None
220+
208221
@classmethod
209222
def parse_version_string(cls, value: str) -> tuple[str, str, str]:
210223
"""

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
comfyui-frontend-package==1.21.3
22
comfyui-workflow-templates==0.1.23
3+
comfyui-embedded-docs==0.2.0
34
torch
45
torchsde
56
torchvision

server.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,13 @@ def add_routes(self):
746746
web.static('/templates', workflow_templates_path)
747747
])
748748

749+
# Serve embedded documentation from the package
750+
embedded_docs_path = FrontendManager.embedded_docs_path()
751+
if embedded_docs_path:
752+
self.app.add_routes([
753+
web.static('/docs', embedded_docs_path)
754+
])
755+
749756
self.app.add_routes([
750757
web.static('/', self.web_root),
751758
])

0 commit comments

Comments
 (0)