Skip to content
Converts Markdown files and strings into NSAttributedString
Branch: master
Clone or download
Latest commit cb2ff2e Oct 11, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
SwiftyMarkdown.playground Using new subscript syntax Sep 24, 2017
SwiftyMarkdown.xcodeproj Updating to Swift 4.2 Oct 11, 2018
SwiftyMarkdown.xcworkspace/xcshareddata
SwiftyMarkdown Version Bump Oct 11, 2018
SwiftyMarkdownExample Updating to Swift 4.2 Oct 11, 2018
SwiftyMarkdownTests Version Bump Oct 11, 2018
fastlane Updating gemfile Oct 11, 2018
.gitignore
.swift-version Updating .swift-version to indacte that podspec should use Swift 4 Sep 24, 2017
Gemfile Updating gems Apr 1, 2017
Gemfile.lock Updating gemfile Oct 11, 2018
LICENSE
README.md
SwiftyMarkdown.podspec Updating podspec Oct 11, 2018

README.md

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.h1.fontSize = 16
md.italic.color = UIColor.blueColor()

Screenshot

Screenshot

You can’t perform that action at this time.