Update icons, hide page title
This commit is contained in:
@ -0,0 +1,25 @@
|
||||
|
||||
struct IconCommandProcessor: CommandProcessor {
|
||||
|
||||
let commandType: ShorthandMarkdownKey = .icons
|
||||
|
||||
|
||||
let results: PageGenerationResults
|
||||
|
||||
init(content: Content, results: PageGenerationResults) {
|
||||
self.results = results
|
||||
}
|
||||
|
||||
func process(_ arguments: [String], markdown: Substring) -> String {
|
||||
var icons = [PageIcon]()
|
||||
for argument in arguments {
|
||||
guard let icon = PageIcon(rawValue: argument) else {
|
||||
results.invalid(command: .icons, markdown)
|
||||
continue
|
||||
}
|
||||
icons.append(icon)
|
||||
}
|
||||
results.require(icons: icons)
|
||||
return ""
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user