Refactor page content generators
This commit is contained in:
18
CHDataManagement/Generator/Commands/CommandProcessor.swift
Normal file
18
CHDataManagement/Generator/Commands/CommandProcessor.swift
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
protocol CommandProcessor {
|
||||
|
||||
static var commandType: CommandType { get }
|
||||
|
||||
var results: PageGenerationResults { get }
|
||||
|
||||
init(content: Content, results: PageGenerationResults, language: ContentLanguage)
|
||||
|
||||
func process(_ arguments: [String], markdown: Substring) -> String
|
||||
}
|
||||
|
||||
extension CommandProcessor {
|
||||
|
||||
func invalid(_ markdown: Substring) {
|
||||
results.invalid(command: Self.commandType, markdown)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user