File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -673,6 +673,7 @@ def create_page(
673673 type = "page" ,
674674 representation = "storage" ,
675675 editor = None ,
676+ full_width = False ,
676677 ):
677678 """
678679 Create page from scratch
@@ -683,6 +684,7 @@ def create_page(
683684 :param type:
684685 :param representation: OPTIONAL: either Confluence 'storage' or 'wiki' markup format
685686 :param editor: OPTIONAL: v2 to be created in the new editor
687+ :param full_width: DEFAULT: False
686688 :return:
687689 """
688690 log .info ('Creating {type} "{space}" -> "{title}"' .format (space = space , title = title , type = type ))
@@ -692,11 +694,15 @@ def create_page(
692694 "title" : title ,
693695 "space" : {"key" : space },
694696 "body" : self ._create_body (body , representation ),
697+ "metadata" : {"properties" : {}},
695698 }
696699 if parent_id :
697700 data ["ancestors" ] = [{"type" : type , "id" : parent_id }]
698701 if editor is not None and editor in ["v1" , "v2" ]:
699- data ["metadata" ] = {"properties" : {"editor" : {"value" : editor }}}
702+ data ["metadata" ]["properties" ]["editor" ] = {"value" : editor }
703+ if full_width is True :
704+ data ["metadata" ]["properties" ]["content-appearance-draft" ] = {"value" : "full-width" }
705+ data ["metadata" ]["properties" ]["content-appearance-published" ] = {"value" : "full-width" }
700706 try :
701707 response = self .post (url , data = data )
702708 except HTTPError as e :
You can’t perform that action at this time.
0 commit comments