Export tools macros
| Set of macros to impact the result when doing a XWiki pages export. |
| Type | XAR |
| Category | Macro |
| Developed by | |
| Rating | |
| License | GNU Lesser General Public License 2.1 |
Table of contents
Description
Set of macros to impact the result when doing a XWiki pages export. This could be useful by example on PDF or ODT export to adapt the content in theses cases.
This extension contains 5 macros:
- export-ignore: which will hide the macro content on the export
- export-only: which will show the macro content only on the export
- Export tools 1.1.0+ export-pagetitle : Override the cover title of the exported document.
- Export tools 1.2.0+ export-pagebreak : Create a page break at the place of the macro.
- Export tools 1.3.0+ export-tablelayout : Customize the table when exported.
Usage
{{export-ignore}}
my content which will be hidden on the export...
{{/export-ignore}}
{{export-only}}
my content which will be shown only on the export...
{{/export-only}}
{{export-pagetitle}}
The custom cover title
{{/export-pagetitle}}
Content before page break...
{{export-pagebreak/}}
Content after page break...
{{export-tablelayout widths="50%,25%,25%"/}}
|Collumn 1|Col 2|Col 3
|Size with 50%|Size with 25%|Size with 25%Feature support
Depending of the macro and the export type the macro feature could be not supported. Here are a summary of the support:
| Macro name | PDF export support | ODF/RTF export support | HTML export support |
|---|---|---|---|
| export-ignore | Yes | Yes | Yes, the macro content won't be in the output HTML |
| export-only | Yes | Yes | Yes, the macro content will be in the output HTML |
| export-pagetitle | Yes (need to use the "Export tools template"). In case of multiple page export, the name will be taken from the root page of the exported space. | No | No |
| export-pagebreak | Yes (need to use the "Export tools template"). | No | No |
| export-tablelayout | Yes (see Table layout section for more details) | No | Yes (The table widths parameter will be taken into account) |
PDF Template
To have some macros working correctly you will need to use a specific PDF template provided by this extension. To use this template you will need to:
- Enable this template into the administration. The document reference is
XWiki.ExportTools.PDFTemplate - Select the "Export tools template" when you do the PDF export
Table layout
Currently this macro only have one parameter to set the size of each columns. The parameter widths accept 2 type of value:
- The relative value. By example
widths="2*,1*,1*,1*. In this case the resulting table in the export would have a first column which is double the width of the 3 remaining equally width columns. - The percent value. By example
widths="25%,25%,25%,25%". The resulting table in the export would then have 4-equal column widths.
Note that the macro does not contain any content. Instead, it applies to the table below the macro.
Prerequisites & Installation Instructions
We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.
You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:
- Log in the wiki with a user having Administration rights
- Go to the Administration page and select the Import category
- Follow the on-screen instructions to upload the downloaded XAR
- Click on the uploaded XAR and follow the instructions
- You'll also need to install all dependent Extensions that are not already installed in your wiki
Versions
Dependencies
Dependencies for this extension (org.xwiki.contrib.export-tools:export-tools-macro-ui 1.3.2):
- org.xwiki.platform:xwiki-platform-rendering-macro-velocity 15.10.15
- org.xwiki.platform:xwiki-platform-rendering-macro-code 15.10.15
- org.xwiki.rendering:xwiki-rendering-macro-html 15.10.15
- org.xwiki.contrib.export-tools:export-tools-api 1.3.2