Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Zenuml support #3872

Closed
wants to merge 66 commits into from
Closed

Conversation

MrCoder
Copy link
Contributor

@MrCoder MrCoder commented Dec 1, 2022

📑 Summary

Added support for ZenUML Diagram.

Resolves #3435

📏 Design Decisions

ZenUML support code is in the mermaid-zenuml folder. Documents and Test are added to corresponding folders.

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added unit/e2e tests (if appropriate)
  • 🔖 targeted develop branch

Copy link
Member

@sidharthv96 sidharthv96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, but I wasn't able to actually get a diagram to render in docs.

You can use the pnpm docs:dev in mermaid package to test.

Tried fixing the docs support, but wasn't able to push the changes.
Adding it as a patch

From 9e206e0b1081ac08348e8ac243cee89121dfa71c Mon Sep 17 00:00:00 2001

---
 cSpell.json                                           | 3 ++-
 packages/mermaid/src/docs/.vitepress/theme/mermaid.ts | 5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/cSpell.json b/cSpell.json
index 64187e1c..afb2cfde 100644
--- a/cSpell.json
+++ b/cSpell.json
@@ -87,7 +87,8 @@
     "visio",
     "vitepress",
     "xlink",
-    "yash"
+    "yash",
+    "zenuml"
   ],
   "patterns": [
     { "name": "Markdown links", "pattern": "\\((.*)\\)", "description": "" },
diff --git a/packages/mermaid/src/docs/.vitepress/theme/mermaid.ts b/packages/mermaid/src/docs/.vitepress/theme/mermaid.ts
index b287346f..59799fb2 100644
--- a/packages/mermaid/src/docs/.vitepress/theme/mermaid.ts
+++ b/packages/mermaid/src/docs/.vitepress/theme/mermaid.ts
@@ -1,8 +1,9 @@
 import mermaid, { type MermaidConfig } from 'mermaid';
-import mindmap from '@mermaid-js/mermaid-mindmap';
+import mindmap from '../../../../../mermaid-mindmap';
+import zenuml from '../../../../../mermaid-zenuml';
 
 try {
-  await mermaid.registerExternalDiagrams([mindmap]);
+  await mermaid.registerExternalDiagrams([mindmap, zenuml]);
 } catch (e) {
   console.error(e);
 }
-- 
2.32.1 (Apple Git-133)

But it seems like there is some error thrown.

image

packages/mermaid-zenuml/src/types/index.d.ts Outdated Show resolved Hide resolved
packages/mermaid-zenuml/src/zenumlRenderer.ts Outdated Show resolved Hide resolved
packages/mermaid-zenuml/src/zenumlRenderer.ts Outdated Show resolved Hide resolved
.eslintrc.json Outdated Show resolved Hide resolved
packages/mermaid-zenuml/package.json Outdated Show resolved Hide resolved
docs/syntax/zenuml.md Show resolved Hide resolved
@MrCoder MrCoder changed the title Zenuml support [WIP] Zenuml support Dec 16, 2022
TODO:load zenuml core from here
Need to manually run 'pnpm run build' in zenuml/core folder.
Included zenuml/core source code to the mermaid repository.
…int`.

It has already been ignored in `package/mermaid-zenuml/zenuml/core/.gitignore`. But the `lint` script does not respect that.
Build zenuml/core in pnpm run build and pnpm run dev.
Fixed component path in core.ts
@MrCoder
Copy link
Contributor Author

MrCoder commented Jan 11, 2023

This PR is replaced by #3983. The new PR include ZenUML/core source code. The new PR will give a much cleaner commit history.

@MrCoder MrCoder closed this Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ZenUML Support
2 participants