Skip to content

Swift bindings for Hoedown, a Markdown parsing library

License

Notifications You must be signed in to change notification settings

hoedown/swift-hoedown

 
 

Repository files navigation

SwiftHoedown

Swift bindings for Hoedown, a Markdown parsing library.

Installation

The recommended way to include SwiftHoedown in your project is by using Carthage. Simply add this line to your Cartfile:

github "njdehoog/swift-hoedown" ~> 0.1

Make sure to link to both the SwiftHoedown and the Hoedown framework. (The separate Hoedown framework is a workaround for this problem).

Usage

Import the framework

import SwiftHoedown

Convert Markdown to HTML

let markdownString = "# Hello Markdown"
let htmlString = Hoedown.renderHTMLForMarkdown(markdownString)

Specify HTML rendering options

let markdownString = "# Hello Markdown"
let htmlString = Hoedown.renderHTMLForMarkdown(markdownString, flags: .Escape)

Specify Markdown rendering extensions

Hoedown has optional support for several (unofficial) Markdown extensions, such as non-strict emphasis, fenced code blocks, tables, auto links, strikethrough and more.

let markdownString = "# Hello Markdown"
let htmlString = Hoedown.renderHTMLForMarkdown(markdown, extensions: [.Tables, .FencedCodeBlocks, .StrikeThrough])

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Credits

SwiftHoedown was developed for use in Spelt. For more info, check out this blog post.

License

SwiftHoedown is released under the MIT license. See LICENSE for details.

For the Hoedown license, see the Hoedown repository.

About

Swift bindings for Hoedown, a Markdown parsing library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 95.3%
  • Objective-C 4.7%