diff --git a/README.md b/README.md index 91a46ea2..a68439cf 100644 --- a/README.md +++ b/README.md @@ -553,6 +553,32 @@ And attach any image with the following The width will be the commented html after the image (in this case 300px). +### Usage with the mermaid-cloud plugin + +> Note: The mermaid-cloud plugin needs to be added to your Confluence instance + +This plugin uses attachments to provide and place the graph in your confluence page, so don't forget to add the attachment. + +```markdown + + + +``` + +> Note: This is a complete example, but Revision and Layout can be ommited from the Template as they are optional. + +And now you only need to add the following to add the mermaid diagram: + +``` +:mermaid:graph.mermaid:1:default: +``` + + ## Installation ### Homebrew diff --git a/pkg/mark/stdlib/stdlib.go b/pkg/mark/stdlib/stdlib.go index 6df86d87..b05b973c 100644 --- a/pkg/mark/stdlib/stdlib.go +++ b/pkg/mark/stdlib/stdlib.go @@ -299,6 +299,15 @@ func templates(api *confluence.API) (*template.Template, error) { `ac:anchor`: text( `{{printf "\n"}}`, `{{ .Anchor }}{{printf "\n"}}`, + `{{printf "\n"}}`, + ), + + /* https://stratus-addons.atlassian.net/wiki/spaces/MDFC/overview?homepageId=1650262147 */ + + `ac:mermaidcloud`: text( + `{{printf "\n"}}`, + `{{ if .Filename }}{{ .Filename }}{{printf "\n"}}{{end}}`, + `{{ if .Revision }}{{ .Revision }}{{printf "\n"}}{{end}}`, `{{printf "\n"}}`, ),