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

Document

mattt edited this page Feb 7, 2020 · 13 revisions

Document

A CommonMark document.

public final class Document: Node

Inheritance

Node

Nested Types

Children.CMarkNodeChildIterator.ContainerOfBlocks.Document.BlockQuote.ContainerOfBlocks.ContainerOfInlineElements, Document.ParsingOptions

Initializers

init(_:)

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

Properties

children

The block's children.

var children: [Inline & Node]

children

The list item's children.

var children: [Node]

children

The block's children.

var children: [Block & Node]

children

The block's children.

var children: [Item]

Methods

remove(child:)

Removes an inline element from the block's children.

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

Parameters

  • child: The inline element to remove.

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.

append(child:)

Adds an inline element to the end of the block's children.

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

Parameters

  • child: The inline element to add.

Returns

true if successful, otherwise false.

insert(child:before:)

Inserts a block to the block's children before a specified sibling.

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

Parameters

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

Returns

true if successful, otherwise false.

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.

append(child:)

Adds a block to the end of the block's children.

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

Parameters

  • child: The block to add.

Returns

true if successful, otherwise false.

insert(child:after:)

Inserts an inline element to the block's children after a specified sibling.

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

Parameters

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

Returns

true if successful, otherwise false.

remove(child:)

Removes a block from the block's children.

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

Parameters

  • child: The block to remove.

Returns

true if successful, otherwise false.

insert(child:before:)

Inserts an inline element to the block's children before a specified sibling.

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

Parameters

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

Returns

true if successful, otherwise false.

insert(child:after:)

Inserts a block to the block's children after a specified sibling.

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

Parameters

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

Returns

true if successful, otherwise false.

append(child:)

Adds a block to the end of the block's children.

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

Parameters

  • child: The block to add.

Returns

true if successful, otherwise false.

prepend(child:)

Adds an inline element to the beginning of the block's children.

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

Parameters

  • child: The inline element 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.

remove(child:)

Removes a block from the block's children.

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

Parameters

  • child: The block to remove.

Returns

true if successful, otherwise false.

prepend(child:)

Adds a block to the beginning of the block's children.

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

Parameters

  • child: The block to add.

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.

prepend(child:)

Adds a block to the beginning of the block's children.

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

Parameters

  • child: The block to add.

Returns

true if successful, otherwise false.

insert(child:after:)

Inserts a block to the block's children after a specified sibling.

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

Parameters

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

Returns

true if successful, otherwise false.

insert(child:before:)

Inserts a block to the block's children before a specified sibling.

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

Parameters

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

Returns

true if successful, otherwise false.

Clone this wiki locally