This article explains how to insert a pie chart within a Wiki Markup macro through through Confluence Command Line Interface (CLI).
Instructions
Create a new page using addPage action and add the wiki mark up macro as content on the page using --content parameter.
Refer to the CLI action given below, where the chart macro is added within the page.
The above action command inserts a pie chart within the Wiki Markup macro and the output is displayed as:Code Block theme Midnight --action addPage --space "~admin" --title "mypagetitle-1" --content "<ac:structured-macro ac:name='chart'><ac:parameter ac:name='title'>Fish Sold</ac:parameter><ac:rich-text-body><table class='wrapped'><colgroup><col/><col/><col/></colgroup><tbody><tr><th><span>Fish Type</span></th><th><span>2004</span></th><th><span>2005</span></th></tr><tr><td><span>Herring</span></td><td><span>9,500</span></td><td>8,300</td></tr></tbody></table></ac:rich-text-body></ac:structured-macro>" --noConvert
Modify an existing page using modifyPage action and add the following wiki mark up macro content on the page:
Code Block theme Midnight --action modifyPage --space "~admin" --title "mypagetitle" --content "<ac:structured-macro ac:name='chart'><ac:parameter ac:name='title'>Fish Sold</ac:parameter><ac:rich-text-body><table class='wrapped'><colgroup><col/><col/><col/></colgroup><tbody><tr><th><span>Fish Type</span></th><th><span>2004</span></th><th><span>2005</span></th></tr><tr><td><span>Herring</span></td><td><span>9,500</span></td><td>8,300</td></tr></tbody></table></ac:rich-text-body></ac:structured-macro>" --noConvert
The parameter noConvert helps to display the output in the wiki format. If not mentioned, the output is displayed as a storage format.
If you want to modify any other data inside the macropage, make changes in the content parameter of the action command accordingly.
Info |
---|
It is recommended to test this scenario in a non-production environment, or, run the action with the --simulate parameter to verify the behavior before deploying. |