-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Incorporate mermaid diagrams #125
Open
astroDimitrios
wants to merge
22
commits into
carpentries:main
Choose a base branch
from
astroDimitrios:feature/mermaid
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ms match the users chosen theme.
…storage instead of session storage
Merged
I forgot to put that you add diagrams in the md like this:
I have bumped the version of Mermaid and updated the CSS as there is something wrong with the figcaption css. This lets the svgs take the full width of the space available. I have also made overflow scrolling optional so if you have a large diagram you should enable overflow scrolling by adding in the
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #34
What: Add the ability to render Mermaid diagrams in the Workbench.
Why: See #34 - You can make all sorts of cool diagrams including flowcharts (learner pathways), git diagrams etc.
Based off css-tricks.
Summary
This adds in the Mermaid Javascript code as a dependency for the workbench. I have included it and squashed it with the other javascript as this was faster than importing as a module/script from the web. I have included the recommended setup from the css-tricks link above so it responds to dark mode. I have used the accessible description Mermaid tag, accDescr, to populate a figure caption for the generated SVG. Some examples are shown below from css-tricks and #34. The git diagram is very large - perhaps lesson creators should consider whether to allow such large diagrams - I have limited the max height to 80% of the view height in the css and set the overflow to scroll.
NOTE: The way the new JS populates the figcaption demands that the accDescr be in the multiline format ie:
Examples
A basic chart:
and with the Diagram source code toggle expanded:
An example from #34 with a title:
The git example from #34 with scroll overflow and title: