Dump Confluence pages using Python (requests) in HTML and RST format, including embedded pictures and attachments. References to downloaded files will be updated to their local relative path.
Nonetheless, the refactoring will require only 2 files and accept command-line args:
myModules.py
: Contains all the required functions.confluenceDumpWithPython.py
: Script to use with the following command line args:
-m, --mode
: The export mode, single
, space
, bylabel
, pageprops
(required).
single
, pageprops
and space
have been implemented so far.-S, --site
: The Atlassian Site (required).-s, --space
: The Space Key (if needed).-p, --page
: The Page ID (if needed).-l, --label
: The Page label (if needed).-x, --sphinx
: The _images
and _static
folders are placed at the root of the export folder, instead of together with the exported HTML files.--notags
: Does not add the tags directives to the rst files (when the sphinx-tags
addon is not used).updatePageLinks.py
: Update online confluence links to the local files that have been downloaded so far.
--folder
: Folder containing the files to update.--test
: Instead of overwriting the original .rst files, it will create updated ones with zout_
as a prefix.getPageEditorVersion.py
: Get the editor version from single pages or all pages in a space.
--site
: The Atlassian Site (required).--page
: Page ID (either/or)--space
: Space Key (either/or)For CSS Styling, it uses the confluence.css
from Confluence that can be obtained by using the Workaround described in: https://jira.atlassian.com/browse/CONFSERVER-40907.
The site.css
file included with Confluence UI HTML exports is not as complete as the one above.
output/
under the same path as the script._images/
and _static/
folders will be placed in the page|space|pageprops|label folder.
--sphinx
command line option will put those folder directly under the output folderstyles/confluence.css
will be copied into the defined _static/
atlassianAPIToken
atlassianUserEmail
confluenceDumpWithPython.py -m single -S -p [
confluenceDumpWithPython.py -m pageprops -S -p [
confluenceDumpWithPython.py -m space -S -s [
No special advice other than:
Contributors names and contact info
@dernorberto
styles/site.css
into output/styles/
if not present.confluenceDumpWithPython.py
& myModules.py
)Purpose of the files:
confluenceExportHTMLrequestsByLabel.py
: download a set of pages based on one (or more) page Labels.confluenceExportHTMLrequestsSingle.py
: download a single page by supplying the page ID as an argument.confluenceExportHTMLrequestsPagePropertiesReport.py
: download page properties and all the pages in the report by supplying the page ID as an argument.confluenceExportHTMLrequestsPagesInSpace.py
: download all pages from a space.This project is licensed under the MIT License - see the LICENSE.txt file for details