Gemini/GeminiFormat/Document.swift

36 lines
649 B
Swift
Raw Normal View History

2020-07-13 03:09:22 +00:00
//
// Document.swift
// GeminiFormat
//
// Created by Shadowfacts on 7/12/20.
//
import Foundation
struct Document {
let url: URL
var lines: [Line]
init(url: URL, lines: [Line] = []) {
self.url = url
self.lines = lines
}
}
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)
}
}
extension Document {
enum HeadingLevel: Int {
case h1 = 1, h2 = 2, h3 = 3
}
}