Skip to content

Converts Markdown files and strings into NSAttributedString

License

Notifications You must be signed in to change notification settings

bkoell/SwiftyMarkdown

This branch is 1 commit ahead of, 176 commits behind SimonFairbairn/SwiftyMarkdown:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

fd8dbd2 · Jun 7, 2017

History

89 Commits
Oct 4, 2016
Apr 1, 2017
Jun 7, 2017
Apr 1, 2017
Apr 1, 2017
Apr 1, 2017
Apr 7, 2016
Oct 4, 2016
Apr 1, 2017
Apr 1, 2017
Mar 5, 2016
Apr 24, 2017
Apr 1, 2017

Repository files navigation

SwiftyMarkdown

SwiftyMarkdown converts Markdown files and strings into NSAttributedString using sensible defaults and a Swift-style syntax. It uses dynamic type to set the font size correctly with whatever font you'd like to use

Installation

CocoaPods:

pod 'SwiftyMarkdown'

Usage

Text string

let md = SwiftyMarkdown(string: "# Heading\nMy *Markdown* string")
md.attributedString()

URL

if let url = Bundle.main.url(forResource: "file", withExtension: "md"), md = SwiftyMarkdown(url: url ) {
	md.attributedString()
}

Supported Features

*italics* or _italics_
**bold** or __bold__

# Header 1
## Header 2
### Header 3
#### Header 4
##### Header 5
###### Header 6

`code`
[Links](http://voyagetravelapps.com/)

Customisation

md.body.fontName = "AvenirNextCondensed-Medium"

md.h1.color = UIColor.redColor()
md.h1.fontName = "AvenirNextCondensed-Bold"
md.italic.color = UIColor.blueColor()

Screenshot

Screenshot

About

Converts Markdown files and strings into NSAttributedString

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 85.3%
  • Ruby 13.6%
  • Objective-C 1.1%