25 lines
649 B
Swift
25 lines
649 B
Swift
|
|
struct BoxCommand: CommandProcessor {
|
|
|
|
static let commandType: CommandType = .box
|
|
|
|
let results: PageGenerationResults
|
|
|
|
init(content: Content, results: PageGenerationResults, language: ContentLanguage) {
|
|
self.results = results
|
|
}
|
|
|
|
/**
|
|
Format: ``
|
|
*/
|
|
func process(_ arguments: [String], markdown: Substring) -> String {
|
|
guard arguments.count > 1 else {
|
|
invalid(markdown)
|
|
return ""
|
|
}
|
|
let title = arguments[0]
|
|
let text = arguments.dropFirst().joined(separator: ";")
|
|
return ContentBox(title: title, text: text).content
|
|
}
|
|
}
|