Closed SvenTiigi closed 5 years ago
Have you tested this code ? Making the initializer public doesn't work for me :
let highlighter = Highlightr()
let theme = Theme(themeString: "github")
highlighter?.theme = theme
let storage = CodeAttributedString(highlightr: highlighter!)
storage.language = "Swift"
textView.layoutManager?.replaceTextStorage(storage)
The solution to make a custom theme is create a new .min.css file and use the setTheme()
method.
Hi @bpisano,
Sorry I forgot to close this PR when I deleted my fork.
As you already mentioned I've used the setTheme()
function to use a custom theme.
Thanks ✌️
Currently the Theme initializer
init(themeString: String)
was set tointernal
. Making the initializerpublic
allows developers to inject custom CSS Highlightr Code.