DOCX Export
DOCX Export
Section titled “DOCX Export”Export Confluence pages to Microsoft Word (DOCX) format using customizable templates.
Prerequisites
Section titled “Prerequisites”- Authenticated profile (
atlcli auth login) - Space permission: View permission on pages to export
- Word-compatible template file (
.docxor.docm)
Quick Start
Section titled “Quick Start”# Export a page using a templateatlcli wiki export 12345678 --template corporate --output ./report.docx
# Export using space:title formatatlcli wiki export "DOCS:Architecture Overview" -t report -o ./arch.docxPage Reference Formats
Section titled “Page Reference Formats”| Format | Example | Description |
|---|---|---|
| Page ID | 12345678 | Numeric Confluence page ID |
| Space:Title | DOCS:My Page | Space key and page title |
| URL | https://... | Full Confluence page URL |
Options
Section titled “Options”| Option | Description |
|---|---|
--template, -t | Template name or path (required) |
--output, -o | Output file path (required) |
--no-images | Don’t embed images from attachments |
--include-children | Include child pages in export |
--no-merge | Keep children as separate array for template loops |
--no-toc-prompt | Disable TOC update prompt in Word |
--profile | Use a specific auth profile |
Templates
Section titled “Templates”Template Resolution
Section titled “Template Resolution”Templates are resolved in order (first match wins):
- Direct file path (if exists)
- Project:
.atlcli/templates/confluence/<name>.docx - Profile:
~/.atlcli/profiles/<profile>/templates/confluence/<name>.docx - Global:
~/.atlcli/templates/confluence/<name>.docx
atlcli supports both .docx and .docm (macro-enabled) templates.
Template Management
Section titled “Template Management”# List available templatesatlcli wiki export template list
# Save a templateatlcli wiki export template save corporate --file ./template.docx --level global
# Delete a templateatlcli wiki export template delete old-template --confirmTemplate Levels
Section titled “Template Levels”| Level | Location | Use Case |
|---|---|---|
project | .atlcli/templates/confluence/ | Project-specific templates |
profile | ~/.atlcli/profiles/<name>/templates/confluence/ | Instance-specific templates |
global | ~/.atlcli/templates/confluence/ | Shared across all projects |
Table of Contents
Section titled “Table of Contents”Confluence TOC Macro
Section titled “Confluence TOC Macro”When a Confluence page contains a :::toc macro, it’s converted to a Word-native TOC field:
:::toc:::The exported TOC:
- Uses Word’s built-in TOC functionality
- Includes heading levels 1-3 with hyperlinks
- Shows placeholder text until updated in Word
TOC Update Behavior
Section titled “TOC Update Behavior”By default, Word prompts to update fields when opening the document:
“This document contains fields that may refer to other files. Do you want to update the fields in this document?”
Click Yes to populate the TOC with correct entries and page numbers.
Disabling the Prompt
Section titled “Disabling the Prompt”Use --no-toc-prompt to disable the update prompt:
atlcli wiki export 12345 -t report -o out.docx --no-toc-promptWhen using this option:
- Word opens without prompting
- TOC shows placeholder text
- Update manually: right-click TOC, select “Update Field”
Template Variables
Section titled “Template Variables”Templates use Jinja2 syntax. Available variables:
Page Content
Section titled “Page Content”| Variable | Description |
|---|---|
{{ title }} | Page title |
{{ content }} | Page content (as Word subdocument) |
{{ pageId }} | Confluence page ID |
{{ pageUrl }} | Full page URL |
{{ tinyUrl }} | Short page URL |
Author Information
Section titled “Author Information”| Variable | Description |
|---|---|
{{ author }} | Creator’s display name |
{{ authorEmail }} | Creator’s email |
{{ modifier }} | Last modifier’s display name |
{{ modifierEmail }} | Last modifier’s email |
| Variable | Description |
|---|---|
{{ created }} | Creation date (ISO format) |
{{ modified }} | Last modified date (ISO format) |
{{ exportDate }} | Export timestamp |
Use the date filter for formatting: {{ modified | date('YYYY-MM-DD') }}
Space Information
Section titled “Space Information”| Variable | Description |
|---|---|
{{ spaceKey }} | Space key (e.g., “DOCS”) |
{{ spaceName }} | Space name |
{{ spaceUrl }} | Space URL |
Collections
Section titled “Collections”| Variable | Description |
|---|---|
{{ labels }} | List of page labels |
{{ attachments }} | List of attachments |
{{ children }} | Child pages (with --include-children --no-merge) |
Examples
Section titled “Examples”Basic Export
Section titled “Basic Export”atlcli wiki export 12345678 --template basic --output ./page.docxExport with Children
Section titled “Export with Children”# Merge children into single documentatlcli wiki export 12345 -t book -o book.docx --include-children
# Keep children separate for template loopsatlcli wiki export 12345 -t book -o book.docx --include-children --no-mergeExport without Images
Section titled “Export without Images”atlcli wiki export 12345 -t report -o report.docx --no-imagesSuppress TOC Prompt
Section titled “Suppress TOC Prompt”atlcli wiki export 12345 -t report -o report.docx --no-toc-promptScroll Word Exporter Compatibility
Section titled “Scroll Word Exporter Compatibility”atlcli supports templates created for Scroll Word Exporter. Scroll placeholders ($scroll.title, $scroll.content, etc.) are automatically converted to the equivalent atlcli variables.
Troubleshooting
Section titled “Troubleshooting”Word Can’t Open the File
Section titled “Word Can’t Open the File”- Ensure the template is a valid
.docxor.docmfile - Check that the template was created in Word 2007 or later
- Try opening the template itself to verify it’s not corrupted
TOC Not Updating
Section titled “TOC Not Updating”- Click inside the TOC
- Right-click and select “Update Field”
- Choose “Update entire table”
Images Not Appearing
Section titled “Images Not Appearing”- Verify images are attached to the Confluence page
- Check that
--no-imagesflag is not set - Embedded images use the template’s image placeholder styling
Related Topics
Section titled “Related Topics”- Pages - Page operations and finding page IDs
- Attachments - Managing page attachments for export
- Templates - Page templates (different from export templates)