Add result handler to templates
This commit is contained in:
@@ -10,4 +10,6 @@ struct BackNavigationTemplate: Template {
|
||||
static let templateName = "back.html"
|
||||
|
||||
let raw: String
|
||||
|
||||
let results: GenerationResultsHandler
|
||||
}
|
||||
|
@@ -10,4 +10,6 @@ struct BoxTemplate: Template {
|
||||
static let templateName = "box.html"
|
||||
|
||||
var raw: String
|
||||
|
||||
let results: GenerationResultsHandler
|
||||
}
|
||||
|
@@ -9,4 +9,6 @@ struct OverviewSectionCleanTemplate: Template {
|
||||
static let templateName = "overview-section-clean.html"
|
||||
|
||||
let raw: String
|
||||
|
||||
let results: GenerationResultsHandler
|
||||
}
|
||||
|
@@ -12,4 +12,6 @@ struct OverviewSectionTemplate: Template {
|
||||
static let templateName = "overview-section.html"
|
||||
|
||||
let raw: String
|
||||
|
||||
let results: GenerationResultsHandler
|
||||
}
|
||||
|
@@ -12,5 +12,7 @@ struct PageHeadTemplate: Template {
|
||||
|
||||
let raw: String
|
||||
|
||||
let results: GenerationResultsHandler
|
||||
|
||||
static let templateName = "head.html"
|
||||
}
|
||||
|
@@ -15,4 +15,6 @@ struct PageImageTemplate: Template {
|
||||
|
||||
let raw: String
|
||||
|
||||
let results: GenerationResultsHandler
|
||||
|
||||
}
|
||||
|
@@ -15,6 +15,8 @@ struct PageLinkTemplate: Template {
|
||||
|
||||
let raw: String
|
||||
|
||||
let results: GenerationResultsHandler
|
||||
|
||||
func makePath(components: [String]) -> String {
|
||||
components.joined(separator: " » ") //  » ")
|
||||
}
|
||||
|
@@ -23,6 +23,8 @@ struct PageVideoTemplate: Template {
|
||||
|
||||
let raw: String
|
||||
|
||||
let results: GenerationResultsHandler
|
||||
|
||||
func generate<T>(sources: [VideoSource], options: T) -> String where T: Sequence, T.Element == VideoOption {
|
||||
let sourcesCode = sources.map(makeSource).joined(separator: "\n")
|
||||
let optionCode = options.map { $0.rawValue }.joined(separator: " ")
|
||||
|
@@ -20,6 +20,8 @@ struct LargeThumbnailTemplate: Template, ThumbnailTemplate {
|
||||
|
||||
let raw: String
|
||||
|
||||
let results: GenerationResultsHandler
|
||||
|
||||
func makeCorner(text: String) -> String {
|
||||
"<span class=\"corner\"><span>\(text)</span></span>"
|
||||
}
|
||||
@@ -36,6 +38,8 @@ struct SquareThumbnailTemplate: Template, ThumbnailTemplate {
|
||||
static let templateName = "thumbnail-square.html"
|
||||
|
||||
let raw: String
|
||||
|
||||
let results: GenerationResultsHandler
|
||||
}
|
||||
|
||||
struct SmallThumbnailTemplate: Template, ThumbnailTemplate {
|
||||
@@ -45,5 +49,7 @@ struct SmallThumbnailTemplate: Template, ThumbnailTemplate {
|
||||
static let templateName = "thumbnail-small.html"
|
||||
|
||||
let raw: String
|
||||
|
||||
let results: GenerationResultsHandler
|
||||
}
|
||||
|
||||
|
@@ -12,4 +12,6 @@ struct TopBarTemplate: Template {
|
||||
static let templateName = "bar.html"
|
||||
|
||||
var raw: String
|
||||
|
||||
let results: GenerationResultsHandler
|
||||
}
|
||||
|
Reference in New Issue
Block a user