Custom Templates (cloud)
Custom templates enable users to create reusable templates out of their Mermaid diagrams. Templates are stored as attachments on pre-configured Confluence page. Because of this, template permissions are set on page level.
Pre-requisites
User must have settings space created before continuing with Custom Templates setup. User will need to perform one-click automatic setup before continuing.
Setup
Mermaid Templates require a root page to be created. It can be stored in any space with proper access permissions. Note that Mermaid settings create separate space and you can use that space to store Mermaid Templates too. Just create separate Page for “Template Root Page”, do not use existing page in that Space. All Child pages of “Template Root Page” represent template categories. Each category is one entry in editor’s Templates popup. By setting access permissions to each page Admin can restrict access to some Template categories. This means every user can have it’s private templates and shared public Templates.
Now create child pages under the page named “Custom Templates“.
Add diagram templates to child pages using mermaid-cloud macro . After adding diagrams to child pages Mermaid editor will show something like this:
Note that every child page is represented as separate item in the templates menu. Every diagram on that page is entry on the right. Select diagram you wish to use as template and click on “Select” button. It will populate editor with diagram data and show preview.