33 lines
618 B
Swift
33 lines
618 B
Swift
|
import Foundation
|
||
|
|
||
|
protocol HeaderTemplate {
|
||
|
|
||
|
func generate(_ content: [ThumbnailKey : String], shouldIndent: Bool) throws -> String
|
||
|
}
|
||
|
|
||
|
enum HeaderKey: String, CaseIterable {
|
||
|
case backLink = "BACK_LINK"
|
||
|
case title = "TITLE"
|
||
|
case subtitle = "SUBTITLE"
|
||
|
case titleText = "TITLE_TEXT"
|
||
|
case date = "DATE"
|
||
|
}
|
||
|
|
||
|
struct CenteredHeaderTemplate: Template {
|
||
|
|
||
|
typealias Key = HeaderKey
|
||
|
|
||
|
let raw: String
|
||
|
|
||
|
static let templateName = "header-center.html"
|
||
|
}
|
||
|
|
||
|
struct LeftHeaderTemplate: Template {
|
||
|
|
||
|
typealias Key = HeaderKey
|
||
|
|
||
|
let raw: String
|
||
|
|
||
|
static let templateName = "header-left.html"
|
||
|
}
|