Source code for atlas_doc_parser.nodes.node_code_block
# -*- coding: utf-8 -*-importtypingasTimportdataclassesfromfunc_args.apiimportOPTfrom..type_enumimportTypeEnumfrom..mark_or_nodeimportBase,BaseNodefrom..markdown_helpersimport(content_to_markdown,ATLASSIAN_LANG_TO_MARKDOWN_LANG_MAPPING,)ifT.TYPE_CHECKING:# pragma: no coverfrom.node_textimportNodeText
[docs]@dataclasses.dataclass(frozen=True)classNodeCodeBlockAttrs(Base):""" Attributes for :class:`NodeCodeBlock`. :param language: Optional. The programming language for syntax highlighting. Uses Prism language identifiers. When set to an unsupported value or "text", code renders as plain monospaced text. :param uniqueId: Optional. A unique identifier for the code block. :param localId: Optional. A local unique identifier for the node. """language:str=OPTuniqueId:str=OPTlocalId:str=OPT
[docs]@dataclasses.dataclass(frozen=True)classNodeCodeBlock(BaseNode):""" A container for lines of code. The codeBlock node is a top-level block node that displays code with optional syntax highlighting. It contains text nodes without any marks (formatting). This node does not support any marks (maxItems: 0 in schema). - https://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/codeBlock/ """type:str=TypeEnum.codeBlock.valueattrs:NodeCodeBlockAttrs=OPTcontent:list["NodeText"]=OPT