nerdsupremacist / syntax-highlight-publish-plugin

Plugin to add syntax highlighting (for multiple languages) to your Publish Site, with the least amount of effort.
MIT License
6 stars 0 forks source link

[Question] Where to place the .tmlanguage file? #2

Closed dthomasen closed 3 years ago

dthomasen commented 3 years ago

I'm trying to add a new language using the syntax below - I have the .tmLanguage file. But I cannot for the life of me figure out how to add the file to the project for the plugin to be able to find it. Should the path be a complete path, relative to the project or something completely different?

extension Grammar { static let kotlin = try! Grammar(textMateFile: URL(fileURLWithPath: "/path/to/Kotlin.tmLanguage")) }

Thanks for this plugin anyways! Seems to great!

nerdsupremacist commented 3 years ago

Hey there! So you have multiple options:

Check out https://github.com/nerdsupremacist/syntax-highlight-publish-plugin/blob/main/Sources/SyntaxHighlightPublishPlugin/Grammar/Grammar%2BtextMate.swift for all the initializers you can use ;)

dthomasen commented 3 years ago

"relativeTextMateFile" was the missing piece!

Thanks a lot! 🚀