Source code for atlas_doc_parser.nodes.node_nested_expand
# -*- coding: utf-8 -*-importtypingasTimportdataclassesfromfunc_args.apiimportREQ,OPTfrom..type_enumimportTypeEnumfrom..mark_or_nodeimportBase,BaseNodefrom..markdown_helpersimportdoc_content_to_markdownifT.TYPE_CHECKING:# pragma: no coverfrom.node_paragraphimportNodeParagraphfrom.node_headingimportNodeHeadingfrom.node_media_singleimportNodeMediaSinglefrom.node_media_groupimportNodeMediaGroupfrom.node_code_blockimportNodeCodeBlockfrom.node_bullet_listimportNodeBulletListfrom.node_ordered_listimportNodeOrderedListfrom.node_task_listimportNodeTaskListfrom.node_decision_listimportNodeDecisionListfrom.node_ruleimportNodeRulefrom.node_panelimportNodePanelfrom.node_blockquoteimportNodeBlockquotefrom.node_extensionimportNodeExtension
[docs]@dataclasses.dataclass(frozen=True)classNodeNestedExpandAttrs(Base):""" Attributes for :class:`NodeNestedExpand`. :param title: Optional. The disclosure label displayed when collapsed. :param localId: Optional. A unique identifier for the node. """title:str=OPTlocalId:str=OPT
[docs]@dataclasses.dataclass(frozen=True)classNodeNestedExpand(BaseNode):""" A container that allows content to be hidden or shown within table cells. The nestedExpand node is similar to an accordion or disclosure widget, allowing users to collapse and expand content. Unlike the regular expand node, nestedExpand can ONLY be placed within TableCell or TableHeader elements - this restriction exists to avoid infinite nesting. Common use cases: - Hiding detailed information in table cells - Creating collapsible sections within complex table layouts - Organizing dense tabular content Reference: https://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/nestedExpand/ """type:str=TypeEnum.nestedExpand.valueattrs:NodeNestedExpandAttrs=REQcontent:list[T.Union["NodeParagraph","NodeHeading","NodeMediaSingle","NodeMediaGroup","NodeCodeBlock","NodeBulletList","NodeOrderedList","NodeTaskList","NodeDecisionList","NodeRule","NodePanel","NodeBlockquote","NodeExtension",]]=REQ
[docs]defto_markdown(self,ignore_error:bool=False,)->str:""" .. note:: We don't preserve expand title in markdown. """md=doc_content_to_markdown(content=self.content,ignore_error=ignore_error)returnmd