struct Markdown Property wrapper to turn any Markdown variable into HTML.
func toHTML (options: [CMarkOption ], extensions: [GFMExtension]) -> String Renders HTML code from the initial Markdown content.
@Markdown property wrapper. Optionally customize every CMark option and GFM extension available.Use this library to generate HTML from a string containing GitHub Flavored Markdown (GFM) / CommonMark content.
For example this code:
# Hello
Hello, _World_!
Will be translated into this code:
<h1>Hello</h1>
<p>Hello, <em>World<em>!</p>
This implementation is built entirely on top of the amazing cmark-gfm which itself is a fork of the excellent cmark.
Just tag your properties with the Markdown wrapper.
@Markdown var content = "# Hello"
// Automatic HTML conversion.
print(content) // "<h1>Hello</h1>"
// Retrieve the original Markdown.
print($content) // "# Hello"
Alternativelly wrap your Markdown string with Markdown and call to with no parameters.
let html = GFMarkdown("# Hello").toHTML()
print(html) // "<h1>Hello</h1>"
struct Markdown func toHTML (options: [CMarkOption ], extensions: [GFMExtension]) -> String enum CMarkOption enum GFMExtension cmark-gfm library for macOS and Linux. We also need to target both supported architectures, namely arm64 and x86_64 . The binaries are then packaged as Xcode Frameworks and distributed via web links.struct MarkdownString