mark
mark copied to clipboard
How to use the `Content by Label` macro?
👋 I couldn't figure out of there was support for the Content by Label macro, is this supported and if so could I get some pointers on how to reference it? If not could this get tagged as an enhancement?
Screenshot below of an example configuration:
You can take a look at the code here https://github.com/kovetskiy/mark/blob/c70eb550fe57bbe2d757835b07c03bc404121cd1/pkg/mark/stdlib/stdlib.go#L144 or here https://github.com/kovetskiy/mark/blob/c70eb550fe57bbe2d757835b07c03bc404121cd1/pkg/mark/stdlib/stdlib.go#L154 to get an idea of how you can create a template for that macro.
The Template code could be, for example:
<ac:structured-macro ac:name="contentbylabel">
{{ if .Max }}<ac:parameter ac:name="max">{{ .Max }}</ac:parameter>{{ end }}
{{ if .Sort }}<ac:parameter ac:name="sort">{{ .Sort }}</ac:parameter>{{ end }}
{{ if .Reverse }}<ac:parameter ac:name="reverse">{{ .Reverse }}</ac:parameter>{{ end }}
{{ if .Title }}<ac:parameter ac:name="title">{{ .Title }}</ac:parameter>{{ end }}
{{ if .ExcludeCurrent }}<ac:parameter ac:name="excludeCurrent">{{ .ExcludeCurrent }}</ac:parameter>{{ end }}
<ac:parameter ac:name="cql">label = "{{ .Label }}"</ac:parameter>
</ac:structured-macro>