Files
GitHawk/Classes/Systems/GithubHighlighting.swift
Ryan Nystrom dc5becb24f Dynamic content size support (#1206)
* add multiplier based on device text size

* adjust settings labels

* syntax highlighting supported
2017-12-09 12:31:23 -05:00

25 lines
552 B
Swift

//
// GithubHighlighting.swift
// Freetime
//
// Created by Ryan Nystrom on 11/25/17.
// Copyright © 2017 Ryan Nystrom. All rights reserved.
//
import Foundation
import Highlightr
enum GithubHighlighting {
private static var shared: Highlightr? = {
let h = Highlightr()
h?.setTheme(to: "github", fontSize: Styles.Sizes.Text.code)
return h
}()
static func highlight(_ code: String, as language: String) -> NSAttributedString? {
return shared?.highlight(code, as: language, fastRender: true)
}
}