Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article explains how to insert a pie chart within a Wiki Markup macro through  through Confluence Command Line Interface (CLI).

Instructions

  1. Create a new page using addPage action and add the wiki mark up macro as content on the page using --content parameter.

  2. Refer to the CLI action given below, where the chart macro is added within the page.

    Code Block
    themeMidnight
    --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
    The above action command inserts a pie chart within the Wiki Markup macro and the output is displayed as:


    Image Modified

  3. Modify an existing page using modifyPage action and add the following wiki mark up macro content on the page:

    Code Block
    themeMidnight
    --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.