Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.

List_Item

mattt edited this page Jan 25, 2020 · 12 revisions

List.Item

public final class Item: Node

Inheritance

Node, ListItemConvertible, Equatable, CustomStringConvertible, Hashable


Initializers

init(children:)

public convenience init(children: [Inline & Node] = [])

init(children:)

public convenience init(children: [Block & Node] = [])

init(_:)

public convenience init(_ closure: () -> String)

init(_:)

public convenience init(_ builder: () -> BlockConvertible)

Properties

cmark_node_type

var cmark_node_type: cmark_node_type

listItemValue

var listItemValue: [List.Item]

description

var description: String

children

The list item's children.

var children: [Node]

Methods

==(lhs:rhs:)

public static func ==(lhs: Node, rhs: Node) -> Bool

hash(into:)

public func hash(into hasher: inout Hasher)

prepend(child:)

Adds a node to the beginning of the list item's children.

@discardableResult public func prepend(child: Node) -> Bool

Parameters

  • child: The block to add.

Returns

true if successful, otherwise false.

append(child:)

Adds a node to the end of the list item's children.

@discardableResult public func append(child: Node) -> Bool

Parameters

  • child: The block to add.

Returns

true if successful, otherwise false.

insert(child:before:)

Inserts a node to the list item's children before a specified sibling.

@discardableResult public func insert(child: Node, before sibling: Node) -> Bool

Parameters

  • child: The block to add.
  • sibling: The child before which the block is added

Returns

true if successful, otherwise false.

insert(child:after:)

Inserts a node to the list item's children after a specified sibling.

@discardableResult public func insert(child: Node, after sibling: Node) -> Bool

Parameters

  • child: The block to add.
  • sibling: The child after which the block is added

Returns

true if successful, otherwise false.

remove(child:)

Removes a node from the list item's children.

@discardableResult public func remove(child: Node) -> Bool

Parameters

  • child: The block to remove.

Returns

true if successful, otherwise false.

Clone this wiki locally