Creating a Link on a Page to Export the Content
You can create a user-macro that can be included anywhere on the Confluence page. Readers of your documentation can later click on the link to export the content with the export scheme defined in the user macro.
Before you begin: Before creating the link you have to create an export scheme and have to copy the REST URL.
To create a link on a page to export the content:
- Click the cog icon at top right of the screen and select Confluence Admin.
The Administration Console is displayed. - In the Configuration section, click User Macros.
The screen User Macros is displayed. - Click Create a User Macro.
- Enter 'export-link' in the field Macro Name.
- Activate the option Visible to all users in the Macro Browser.
- Enter 'Export Link' in the field Macro Title.
- Enter 'Creates an export-link' in the field Description.
- Select Formatting in the Categories drop-down.
- Leave the field Icon URL empty.
- Enter the url of this page in the field Documentation URL.
- Activate the option No macro body.
Replace the text in the field Template with the following code:
CODE## @param ExportSchemeId:title=Export Scheme Id|type=string|required=true <a class="scroll-html-launcher" data-export-scheme-id="$paramExportSchemeId" href="#">Export to HTML</a>
- Click Save.
The macro is created and can now be used in a page.
To use the macro on a page:
- Open the wanted page and click Edit.
- Enter '{export link' and press Enter.
The screen Insert 'Export Link' Macro is displayed. - In the field Export Scheme Id enter the export scheme Id from your copied REST URL, for example:
SUP-7F00010101402A5F3374B26C22502A2F
The export scheme Id is displayed in the REST URL between the '=' and the '&' - Click Insert and save the page.
The macro is inserted to the page and can be used by readers to export the content with the defined export scheme.