improvements on the ui
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import Foundation
|
||||
|
||||
/// The lorem text that `#lorem` puts in the page: an opening sentence of 16 words, two paragraphs and a contact sample.
|
||||
/// The lorem text that `#lorem` puts in the page: a bookmark, an opening sentence of 16 words, two paragraphs and a contact sample.
|
||||
public struct LoremText: Equatable, Sendable {
|
||||
public static let trigger = "#lorem"
|
||||
/// The first line of the lorem text, so it shows in the bookmark index.
|
||||
public static let bookmark = "=lorem"
|
||||
public static let openingWords = 16
|
||||
public static let paragraphSentences = 3...5
|
||||
public static let resourceBundleName = "Plak_PlakCore.bundle"
|
||||
@@ -17,9 +19,9 @@ public struct LoremText: Equatable, Sendable {
|
||||
self.contacts = contacts
|
||||
}
|
||||
|
||||
/// The sentence, the two paragraphs, the phones, the addresses and the e-mails, with a blank line between each.
|
||||
/// The bookmark, the sentence, the two paragraphs, the phones, the addresses and the e-mails, with a blank line between each.
|
||||
public var text: String {
|
||||
([opening] + paragraphs.map { $0.joined(separator: " ") } + contacts.blocks).joined(separator: "\n\n")
|
||||
([Self.bookmark, opening] + paragraphs.map { $0.joined(separator: " ") } + contacts.blocks).joined(separator: "\n\n")
|
||||
}
|
||||
|
||||
public static func wordCount(_ sentence: String) -> Int {
|
||||
|
||||
Reference in New Issue
Block a user