Loading
Insert and preview mermaid/plantuml/kroki diagrams in content editor
What does this MR do and why?
Allow inserting and previewing mermaid/plantuml/kroki diagrams in content editor by sending a request to the backend to get the diagram URL
Related issues
Screenshots or screen recordings
How to set up and validate locally
Preparing PlantUML and Kroki diagrams
Enable PlantUML and Kroki in Admin -> Settings -> General
Sample PlantUML/Kroki/Mermaid codes
Example codes:
|
|
|
Validating existing Mermaid/PlantUML/Kroki diagrams
- Create or edit a wiki page.
- In the plain text editor enter a sample Mermaid/PlantUML/Kroki code. (Use sample codes from the table above.)
- Click "Edit rich text" to switch to content editor.
- In the code block bubble menu, notice that the "eye" icon to preview the plantuml diagram should already be enabled. (Clicking it will disable the preview for that diagram.)
- Edit the diagram source and notice that the diagram preview live updates.
Inserting a new Mermaid/PlantUML diagram from the + menu
- Create or edit a wiki page.
- Click "Edit rich text" to switch to content editor.
- In the toolbar, click the
+button and select either Mermaid or PlantUML diagram. - Enter a sample Mermaid/PlantUML code. (Use sample codes from the table above.)
- In the code block bubble menu, notice that the "eye" icon to preview the plantuml diagram should already be enabled. (Clicking it will disable the preview for that diagram.)
- Edit the diagram source and notice that the diagram preview live updates.
Note
It is currently not possible to insert a kroki diagram from the menu.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
- I have evaluated the MR acceptance checklist for this MR.
Edited by Himanshu Kapoor
