Begin configuration for constants
This commit is contained in:
@ -4,9 +4,6 @@ import Splash
|
||||
|
||||
struct PageContentGenerator {
|
||||
|
||||
#warning("Specify page image width in configuration")
|
||||
let pageImageWidth = 748
|
||||
|
||||
private let factory: TemplateFactory
|
||||
|
||||
private let swift = SyntaxHighlighter(format: HTMLOutputFormat())
|
||||
@ -83,11 +80,11 @@ struct PageContentGenerator {
|
||||
private func handleImage(page: Element, file: String, rightTitle: String?, leftTitle: String?) -> String {
|
||||
let imagePath = page.pathRelativeToRootForContainedInputFile(file)
|
||||
|
||||
let size = files.requireImage(source: imagePath, destination: imagePath, width: pageImageWidth)
|
||||
let size = files.requireImage(source: imagePath, destination: imagePath, width: configuration.pageImageWidth)
|
||||
|
||||
let imagePath2x = imagePath.insert("@2x", beforeLast: ".")
|
||||
let file2x = file.insert("@2x", beforeLast: ".")
|
||||
files.requireImage(source: imagePath, destination: imagePath2x, width: 2 * pageImageWidth)
|
||||
files.requireImage(source: imagePath, destination: imagePath2x, width: 2 * configuration.pageImageWidth)
|
||||
|
||||
let content: [PageImageTemplate.Key : String] = [
|
||||
.image: file,
|
||||
|
Reference in New Issue
Block a user