Resolver
public final class Resolver : Sendable
Class used to resolve nodes to tags based on customizable rules.
-
Rule describing how to resolve tags from regex patterns.
See moreDeclaration
Swift
public struct Rule : Sendable -
The rules used by this resolver to resolve nodes to tags.
Declaration
Swift
public let rules: [Rule] -
Resolve a tag name from a given node.
Parameters
nodeNode whose tag should be resolved.
Return Value
The resolved tag name.
-
Returns a Resolver constructed by appending rule.
Declaration
Swift
public func appending(_ rule: Rule) -> Resolver -
Returns a Resolver constructed by appending pattern for tag.
Declaration
Swift
public func appending(_ tag: Tag.Name, _ pattern: String) throws -> Resolver -
Returns a Resolver constructed by replacing rule.
Declaration
Swift
public func replacing(_ rule: Rule) -> Resolver -
Returns a Resolver constructed by replacing pattern for tag.
Declaration
Swift
public func replacing(_ tag: Tag.Name, with pattern: String) throws -> Resolver -
Returns a Resolver constructed by removing pattern for tag.
Declaration
Swift
public func removing(_ tag: Tag.Name) -> Resolver
-
Resolver with no rules.
Declaration
Swift
public static let basic: Resolver -
Resolver with a default set of rules.
Declaration
Swift
public static let `default`: Resolver
View on GitHub
Install in Dash