Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.
mattt edited this page Dec 21, 2020 · 11 revisions

Node

A CommonMark node.

public class Node: Codable

Inheritance

Codable, CustomStringConvertible, Equatable, Hashable

Initializers

init(from:)

public required convenience init(from decoder: Decoder) throws

Properties

range

The line and column range of the element in the document.

var range: ClosedRange<Document.Position>

parent

The parent of the element, if any.

var parent: Node?

description

var description: String

Methods

render(format:options:width:)

Render a document into a given format with the specified options.

public func render(format: RenderingFormat, options: RenderingOptions = [], width: Int = 0) -> String

Parameters

  • format: The rendering format
  • options: The rendering options
  • width: The column width used to wrap lines for rendered output (.commonmark, .man, and .latex formats only). Must be a positive number. Pass 0 to prevent line wrapping.

Returns

The rendered text.

encode(to:)

public func encode(to encoder: Encoder) throws

==(lhs:rhs:)

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

hash(into:)

public func hash(into hasher: inout Hasher)
Clone this wiki locally