Add alt text to images

This commit is contained in:
Christoph Hagen
2022-12-21 12:59:42 +01:00
parent 7a0e1300ac
commit 5ecfc0d51d
9 changed files with 66 additions and 57 deletions

View File

@ -1,21 +0,0 @@
import Foundation
struct EnlargeableImageTemplate: Template {
enum Key: String, CaseIterable {
case image = "IMAGE"
case imageExtension = "IMAGE_EXT"
case width = "WIDTH"
case height = "HEIGHT"
case leftText = "LEFT_TEXT"
case rightText = "RIGHT_TEXT"
case number = "NUMBER"
}
static let templateName = "image-enlargeable.html"
let raw: String
let results: GenerationResultsHandler
}

View File

@ -1,15 +1,31 @@
import Foundation
enum PageImageTemplateKey: String, CaseIterable {
case altText = "ALT_TEXT"
case image = "IMAGE"
case imageExtension = "IMAGE_EXT"
case width = "WIDTH"
case height = "HEIGHT"
case leftText = "LEFT_TEXT"
case rightText = "RIGHT_TEXT"
case number = "NUMBER"
}
struct EnlargeableImageTemplate: Template {
typealias Key = PageImageTemplateKey
static let templateName = "image-enlargeable.html"
let raw: String
let results: GenerationResultsHandler
}
struct PageImageTemplate: Template {
enum Key: String, CaseIterable {
case image = "IMAGE"
case imageExtension = "IMAGE_EXT"
case width = "WIDTH"
case height = "HEIGHT"
case leftText = "LEFT_TEXT"
case rightText = "RIGHT_TEXT"
}
typealias Key = PageImageTemplateKey
static let templateName = "image.html"

View File

@ -3,6 +3,7 @@ import Foundation
struct PageLinkTemplate: Template {
enum Key: String, CaseIterable {
case altText = "ALT_TEXT"
case url = "URL"
case image = "IMAGE"
case title = "TITLE"

View File

@ -3,6 +3,7 @@ import Foundation
struct SlideshowImageTemplate: Template {
enum Key: String, CaseIterable {
case altText = "ALT_TEXT"
case url = "URL"
case image = "IMAGE"
case title = "TITLE"

View File

@ -6,6 +6,7 @@ protocol ThumbnailTemplate {
}
enum ThumbnailKey: String, CaseIterable {
case altText = "ALT_TEXT"
case url = "URL"
case image = "IMAGE"
case title = "TITLE"