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

Document

mattt edited this page Jan 24, 2020 · 13 revisions

Document

A CommonMark document.

public final class Document: Node

Inheritance

Node, Hashable, Equatable, CustomStringConvertible, CustomReflectable


Nested Types


Initializers

init(_:options:)

Creates a document from a CommonMark string.

public convenience init(_ commonmark: String, options: ParsingOptions = []) throws
  • Parameter commonmark: A CommonMark string.

Parameters

  • Document.Error.invalid if a document couldn't be constructed with the provided source.

init(children:)

public convenience init(children: [Child] = [])

init(_:)

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

Properties

cmark_node_type

var cmark_node_type: cmark_node_type

description

var description: String

customMirror

var customMirror: Mirror

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.

hash(into:)

public func hash(into hasher: inout Hasher)

==(lhs:rhs:)

public static func ==(lhs: Node, rhs: Node) -> Bool
Clone this wiki locally