Gemini/GeminiFormat/Document.swift

36 lines
684 B
Swift

//
// Document.swift
// GeminiFormat
//
// Created by Shadowfacts on 7/12/20.
//
import Foundation
public struct Document {
public let url: URL
public var lines: [Line]
init(url: URL, lines: [Line] = []) {
self.url = url
self.lines = lines
}
}
public extension Document {
enum Line: Equatable {
case text(String)
case link(URL, text: String?)
case preformattedText(String, alt: String?)
case heading(String, level: HeadingLevel)
case unorderedListItem(String)
case quote(String)
}
}
public extension Document {
enum HeadingLevel: Int {
case h1 = 1, h2 = 2, h3 = 3
}
}