Node - SwiftDocOrg/CommonMark GitHub Wiki
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.latexformats only). Must be a positive number. Pass0to 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)