pub struct AdfNode {
pub node_type: String,
pub attrs: Option<Value>,
pub content: Option<Vec<Self>>,
pub text: Option<String>,
pub marks: Option<Vec<AdfMark>>,
pub local_id: Option<String>,
pub parameters: Option<Value>,
}Expand description
A node in the ADF tree.
Represents both block nodes (paragraph, heading, codeBlock, etc.) and inline nodes (text, hardBreak, mention, etc.).
Fields§
§node_type: StringThe node type identifier (e.g., “paragraph”, “text”, “heading”).
attrs: Option<Value>Node-specific attributes (e.g., heading level, code language).
content: Option<Vec<Self>>Child content nodes.
text: Option<String>Text content (only present on text nodes).
marks: Option<Vec<AdfMark>>Inline marks applied to this node (bold, italic, link, etc.).
local_id: Option<String>Top-level local ID (used by expand, nestedExpand, and other node types).
parameters: Option<Value>Top-level parameters (used by expand nodes with macroMetadata, etc.).
Implementations§
Source§impl AdfNode
impl AdfNode
Sourcepub fn text_with_marks(content: &str, marks: Vec<AdfMark>) -> Self
pub fn text_with_marks(content: &str, marks: Vec<AdfMark>) -> Self
Creates a text node with marks applied.
Sourcepub fn paragraph(content: Vec<Self>) -> Self
pub fn paragraph(content: Vec<Self>) -> Self
Creates a paragraph node with the given inline content.
Sourcepub fn code_block(language: Option<&str>, text: &str) -> Self
pub fn code_block(language: Option<&str>, text: &str) -> Self
Creates a code block node.
Sourcepub fn blockquote(content: Vec<Self>) -> Self
pub fn blockquote(content: Vec<Self>) -> Self
Creates a blockquote node.
Sourcepub fn bullet_list(items: Vec<Self>) -> Self
pub fn bullet_list(items: Vec<Self>) -> Self
Creates a bullet list node.
Sourcepub fn ordered_list(items: Vec<Self>, start: Option<u32>) -> Self
pub fn ordered_list(items: Vec<Self>, start: Option<u32>) -> Self
Creates an ordered list node.
Sourcepub fn hard_break() -> Self
pub fn hard_break() -> Self
Creates a hard break node.
Sourcepub fn table_with_attrs(rows: Vec<Self>, attrs: Value) -> Self
pub fn table_with_attrs(rows: Vec<Self>, attrs: Value) -> Self
Creates a table node with attributes (layout, isNumberColumnEnabled).
Sourcepub fn table_header(content: Vec<Self>) -> Self
pub fn table_header(content: Vec<Self>) -> Self
Creates a table header cell node.
Sourcepub fn table_header_with_attrs(content: Vec<Self>, attrs: Value) -> Self
pub fn table_header_with_attrs(content: Vec<Self>, attrs: Value) -> Self
Creates a table header cell node with attributes (colspan, rowspan, background, colwidth).
Sourcepub fn table_cell(content: Vec<Self>) -> Self
pub fn table_cell(content: Vec<Self>) -> Self
Creates a table cell node.
Sourcepub fn table_cell_with_attrs(content: Vec<Self>, attrs: Value) -> Self
pub fn table_cell_with_attrs(content: Vec<Self>, attrs: Value) -> Self
Creates a table cell node with attributes (colspan, rowspan, background, colwidth).
Sourcepub fn table_header_with_attrs_and_marks(
content: Vec<Self>,
attrs: Option<Value>,
marks: Vec<AdfMark>,
) -> Self
pub fn table_header_with_attrs_and_marks( content: Vec<Self>, attrs: Option<Value>, marks: Vec<AdfMark>, ) -> Self
Creates a table header cell node with attributes and marks.
Sourcepub fn table_cell_with_attrs_and_marks(
content: Vec<Self>,
attrs: Option<Value>,
marks: Vec<AdfMark>,
) -> Self
pub fn table_cell_with_attrs_and_marks( content: Vec<Self>, attrs: Option<Value>, marks: Vec<AdfMark>, ) -> Self
Creates a table cell node with attributes and marks.
Sourcepub fn inline_card(url: &str) -> Self
pub fn inline_card(url: &str) -> Self
Creates an inline card node for a smart link (URL as both text and href).
Sourcepub fn media_inline(attrs: Value) -> Self
pub fn media_inline(attrs: Value) -> Self
Creates a mediaInline node with the given attributes.
Sourcepub fn media_single(url: &str, alt: Option<&str>) -> Self
pub fn media_single(url: &str, alt: Option<&str>) -> Self
Creates a media single node wrapping an external image.
Sourcepub fn task_item(state: &str, content: Vec<Self>) -> Self
pub fn task_item(state: &str, content: Vec<Self>) -> Self
Creates a task item node with state "TODO" or "DONE".
Sourcepub fn placeholder(text: &str) -> Self
pub fn placeholder(text: &str) -> Self
Creates a placeholder node.
Sourcepub fn block_card(url: &str) -> Self
pub fn block_card(url: &str) -> Self
Creates a block card node (smart link displayed as a block).
Sourcepub fn embed_card(
url: &str,
layout: Option<&str>,
original_height: Option<f64>,
width: Option<f64>,
) -> Self
pub fn embed_card( url: &str, layout: Option<&str>, original_height: Option<f64>, width: Option<f64>, ) -> Self
Creates an embed card node.
Sourcepub fn expand(title: Option<&str>, content: Vec<Self>) -> Self
pub fn expand(title: Option<&str>, content: Vec<Self>) -> Self
Creates an expand (collapsible) node.
Sourcepub fn nested_expand(title: Option<&str>, content: Vec<Self>) -> Self
pub fn nested_expand(title: Option<&str>, content: Vec<Self>) -> Self
Creates a nested expand node.
Sourcepub fn layout_section(columns: Vec<Self>) -> Self
pub fn layout_section(columns: Vec<Self>) -> Self
Creates a layout section node.
Sourcepub fn layout_column(width: f64, content: Vec<Self>) -> Self
pub fn layout_column(width: f64, content: Vec<Self>) -> Self
Creates a layout column node.
Sourcepub fn decision_list(items: Vec<Self>) -> Self
pub fn decision_list(items: Vec<Self>) -> Self
Creates a decision list node.
Sourcepub fn decision_item(state: &str, content: Vec<Self>) -> Self
pub fn decision_item(state: &str, content: Vec<Self>) -> Self
Creates a decision item node.
Sourcepub fn extension(
extension_type: &str,
extension_key: &str,
params: Option<Value>,
) -> Self
pub fn extension( extension_type: &str, extension_key: &str, params: Option<Value>, ) -> Self
Creates a void (block) extension node.
Sourcepub fn bodied_extension(
extension_type: &str,
extension_key: &str,
content: Vec<Self>,
) -> Self
pub fn bodied_extension( extension_type: &str, extension_key: &str, content: Vec<Self>, ) -> Self
Creates a bodied extension node (extension with block content).