Created
October 23, 2021 02:16
-
-
Save griffin-stewie/ef4d0b5a41487a38c926482573afc3ce to your computer and use it in GitHub Desktop.
Extension which write-to support for swift-markdown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import Markdown | |
extension Markup { | |
func write(to destination: URL, formatOptions: MarkupFormatter.Options = .default, atomically useAuxiliaryFile: Bool = true, encoding: String.Encoding = .utf8) throws { | |
let string = format(options: formatOptions) | |
try string.write(to: destination, atomically: useAuxiliaryFile, encoding: encoding) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment