Last active
June 14, 2017 08:15
-
-
Save taji-taji/8046b47f85522805f8243f034a7628ae to your computer and use it in GitHub Desktop.
This file contains hidden or 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 SwiftMarkdown | |
| let markdown = "# Hello" | |
| if let html = try? markdownToHTML(markdown) { | |
| print(html) // -> "<h1>Hello</h1>\n" | |
| } |
This file contains hidden or 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
| // マークダウンファイルからHTML文字列を作成する | |
| import Foundation | |
| import SwiftMarkdown | |
| let markdownFilePath = "path/to/your/markdown.md" | |
| // ファイルパスを指定して文字列を取得 | |
| let markdown = try? String(contentsOfFile: markdownFilePath) | |
| if let markdown = markdown { | |
| let html = try? markdownToHTML(markdown) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment