Fix custom-tags to make it clear where the implementation is (#671)

This commit is contained in:
dannflor 2022-06-27 13:42:02 -06:00 committed by GitHub
parent 4e170d1b7e
commit f7fa29d260
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 13 deletions

View File

@ -22,6 +22,7 @@ Now let's implement the `render(_:)` method. The `LeafContext` context passed to
```swift
struct NowTagError: Error {}
func render(_ ctx: LeafContext) throws -> LeafData {
let formatter = DateFormatter()
switch ctx.parameters.count {
case 0: formatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
@ -36,6 +37,7 @@ default:
let dateAsString = formatter.string(from: Date())
return LeafData.string(dateAsString)
}
```
!!! tip