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

Documentation

mattt edited this page Jan 23, 2020 · 12 revisions

Documentation

Documentation for a Swift declaration.

public struct Documentation

Inheritance

Equatable, Codable, Hashable


Nested Types

  • Documentation.Callout
  • Documentation.Callout.Delimiter

Initializers

init(from:)

public init(from decoder: Decoder) throws

Properties

summary

The summary.

var summary: String?

discussionParts

The text segments and callouts that comprise the discussion, if any.

var discussionParts: [DiscussionPart] = []

parameters

The documented parameters.

var parameters: [(name: String, description: String)] = []

returns

The documented return value.

var returns: String?

throws

The documented error throwing behavior.

var `throws`: String?

delimiter

var delimiter: Delimiter

content

var content: String

Methods

parse(_:)

Create and return documentation from Swift Markup text.

public static func parse(_ text: String?) throws  -> Documentation
  • Parameters
    • text: The documentation text in Swift Markup (CommonMark) format.

Parameters

  • CommonMark.Document.Error if the provided text can't be parsed.

Returns

A structured representation of the documentation.

==(lhs:rhs:)

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

encode(to:)

public func encode(to encoder: Encoder) throws

hash(into:)

public func hash(into hasher: inout Hasher)