-
Notifications
You must be signed in to change notification settings - Fork 133
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
Add Mermaid Plugin #2475
Add Mermaid Plugin #2475
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2475 +/- ##
==========================================
- Coverage 51.05% 50.91% -0.14%
==========================================
Files 126 126
Lines 5467 5450 -17
Branches 1174 1171 -3
==========================================
- Hits 2791 2775 -16
+ Misses 2381 2380 -1
Partials 295 295 ☔ View full report in Codecov by Sentry. |
Nice work! It looks good and the documentation is clear - though I'd like to play around with it a little more before approving I am wondering if we should have it be a separate test site, as this is also a plugin similar to algolia and the like. We should probably come to a decision and then include this in the developer guide for guidance |
I think implementation look good to me. Just like Hannah, I need more time to play around and test it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok the mermaid website is broken so I can't test it but some nits about documentation first!
docs/userGuide/plugins/mermaid.md
Outdated
@@ -0,0 +1,96 @@ | |||
### Plugin: Mermaid | |||
|
|||
This plugin allows you to utilize <tooltip content="Mermaid lets you create diagrams and visualizations using text and code">Mermaid</tooltip> by automatically importing the library and initializing the rendering of the diagrams. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think linking to the Mermaid documentation here is better than using a tool tip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somewhat agree but I really liked the effect of the tooltip as well. Maybe at the bit where we talk about external plugins, we can add tooltips to the documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tooltip has been removed. Looking for more advice.
cb84513
to
69ec838
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Tim-Siu thanks for the PR! The test site doesn't seem to be working... could you check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits and improvements on test case! This looks great the mermaid diagrams look really awesome
@@ -0,0 +1,71 @@ | |||
**Mermaid Test** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add a functional test to make sure that mermaid works when using include?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I mistook it for a unit test and was thinking about how to achieve this. Thank you for your reminder!
LGTM. I think the implementation is good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits! Also @Tim-Siu when modifying all your PRs could you please make sure that you address all the comments on the review? If you disagree with it, you can reply on why you disagree rather than leaving it.
@@ -0,0 +1,71 @@ | |||
**Mermaid Test** |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Sorry for the confusion, I will keep clearer communications next time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment and i think should be good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments
@@ -65,6 +65,8 @@ MarkBind has a set of built-in plugins that can be used immediately without inst | |||
<include src="plugins/mathDelimiters.md" /> | |||
<include src="plugins/web3Form.md" /> | |||
<include src="plugins/dataTable.md" /> | |||
<include src="plugins/mermaid.md" /> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary new line
|
||
<include src="testMermaidFragment.md" /> | ||
|
||
<panel type="minimal" header="This is to test Mermaid diagrams works when included inside a panel." src="testMermaidFragment.md"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<panel type="minimal" header="This is to test Mermaid diagrams works when included inside a panel." src="testMermaidFragment.md"> | |
<panel type="minimal" header="This is to test Mermaid diagrams works when included inside a panel." src="testMermaidFragment.md"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use the word fragment here because include fragment means like a partial include
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@Tim-Siu Good work on adding this. While we are on this topic, is there a reason (e.g., performance cost) for not enabling this plugin (and the data table plugin) by default? Normally, we want to make 'everything works out of the box' (i.e., requires minimal configuration by the user. |
Hi @damithc , For the For the |
@Tim-Siu I see. Is an 'enable by default, but don't load if not used' approach feasible? |
I think it is possible to achieve this in the page build stage. I can do some research and work on it after the exams. |
@Tim-Siu I see. Perhaps, something to try in future. Perhaps create an issue for it now so that we keep it in view? |
Sure! |
Co-authored-by: Tim-Siu <shuyao@u.nus.edu> Co-authored-by: yucheng2207 <e0560244@u.nus.edu> Co-authored-by: david <71922282+itsyme@users.noreply.github.com>
What is the purpose of this pull request?
Overview of changes:
Related to #2052
Related to #1663 for pie-chart
Related to #984 for diagramming tool
This pull request is a continuation of the work done in the previously closed pull request #2052. It builds upon the changes and addresses the diagrams not rendered inside Vue components issue.
I would like to acknowledge and give credit to the original author, @tlylt , for his initial contribution and efforts in the closed pull request. Their work laid the foundation for the changes proposed in this new pull request.
Some changes include:
Please review the changes and provide any further feedback or suggestions for improvement. Thank you!
Anything you'd like to highlight/discuss:
Based on my ''ablation studies'', it seems like that importing the script will results in automatic initialization (for diagrams outside of Vue components) and the Vue directive will initialize the diagrams inside Vue components.
Testing instructions:
Proposed commit message: (wrap lines at 72 characters)
Support Mermaid
Checklist: ☑️
Reviewer checklist:
Indicate the SEMVER impact of the PR:
At the end of the review, please label the PR with the appropriate label:
r.Major
,r.Minor
,r.Patch
.Breaking change release note preparation (if applicable):