feat: support mermaid graphs (#128)

This commit is contained in:
Leandro Carneiro
2021-10-25 06:51:56 -03:00
committed by GitHub
parent ee0a6e23e7
commit e635d1f945
3 changed files with 61 additions and 2 deletions

View File

@@ -109,8 +109,9 @@ func templates(api *confluence.API) (*template.Template, error) {
`{{ if .Title }}<ac:parameter ac:name="title">{{ .Title }}</ac:parameter>{{printf "\n"}}{{ end }}`,
`<ac:rich-text-body>{{printf "\n"}}{{ end }}`,
`<ac:structured-macro ac:name="code">{{printf "\n"}}`,
/**/ `<ac:parameter ac:name="language">{{ .Language }}</ac:parameter>{{printf "\n"}}`,
`<ac:structured-macro ac:name="{{ if eq .Language "mermaid" }}cloudscript-confluence-mermaid{{ else }}code{{ end }}">{{printf "\n"}}`,
/**/ `{{ if eq .Language "mermaid" }}<ac:parameter ac:name="showSource">true</ac:parameter>{{printf "\n"}}{{ else }}`,
/**/ `<ac:parameter ac:name="language">{{ .Language }}</ac:parameter>{{printf "\n"}}{{ end }}`,
/**/ `<ac:parameter ac:name="collapse">{{ .Collapse }}</ac:parameter>{{printf "\n"}}`,
/**/ `{{ if .Title }}<ac:parameter ac:name="title">{{ .Title }}</ac:parameter>{{printf "\n"}}{{ end }}`,
/**/ `<ac:plain-text-body><![CDATA[{{ .Text | cdata }}]]></ac:plain-text-body>{{printf "\n"}}`,