List_Item - SwiftDocOrg/CommonMark GitHub Wiki
public final class Item: NodeNode, Visitable, ListItemConvertible
public convenience init(children: [Inline & Node] = [])public convenience init(children: [Block & Node] = [])public convenience init(_ closure: () -> String)public convenience init(_ builder: () -> BlockConvertible)The elements contained by the list item.
var children: [Node]var listItemValue: [List.Item]Adds a node to the beginning of the list item's children.
@discardableResult public func prepend(child: Node) -> Bool- child: The node to add.
true if successful, otherwise false.
Adds a node to the end of the list item's children.
@discardableResult public func append(child: Node) -> Bool- child: The node to add.
true if successful, otherwise false.
Inserts a node to the list item's children before a specified sibling.
@discardableResult public func insert(child: Node, before sibling: Node) -> Bool- child: The node to add.
- sibling: The child before which the node is added
true if successful, otherwise false.
Inserts a node to the list item's children after a specified sibling.
@discardableResult public func insert(child: Node, after sibling: Node) -> Bool- child: The node to add.
- sibling: The child after which the node is added
true if successful, otherwise false.
Replaces a node with a specified node.
@discardableResult public func replace(child: Node, with replacement: Node) -> Bool- child: The node to replace.
- replacement: The node to replace the existing node.
true if successful, otherwise false.
Removes a node from the list item's children.
@discardableResult public func remove(child: Node) -> Bool- child: The node to remove.
true if successful, otherwise false.
Removes and returns the list item's children.
public func removeChildren() -> [Node]An array of nodes.
public func accept<T: Visitor>(visitor: T)