Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion atlassian/confluence.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ def create_page(
type="page",
representation="storage",
editor=None,
full_width=False,
):
"""
Create page from scratch
Expand All @@ -683,6 +684,7 @@ def create_page(
:param type:
:param representation: OPTIONAL: either Confluence 'storage' or 'wiki' markup format
:param editor: OPTIONAL: v2 to be created in the new editor
:param full_width: DEFAULT: False
:return:
"""
log.info('Creating {type} "{space}" -> "{title}"'.format(space=space, title=title, type=type))
Expand All @@ -692,11 +694,15 @@ def create_page(
"title": title,
"space": {"key": space},
"body": self._create_body(body, representation),
"metadata": {"properties": {}},
}
if parent_id:
data["ancestors"] = [{"type": type, "id": parent_id}]
if editor is not None and editor in ["v1", "v2"]:
data["metadata"] = {"properties": {"editor": {"value": editor}}}
data["metadata"]["properties"]["editor"] = {"value": editor}
if full_width is True:
data["metadata"]["properties"]["content-appearance-draft"] = {"value": "full-width"}
data["metadata"]["properties"]["content-appearance-published"] = {"value": "full-width"}
try:
response = self.post(url, data=data)
except HTTPError as e:
Expand Down