Is it possible to define a custom language for code highlighting?
I’d be interested to know where the definitions for things like putting ```ruby come from. Would I find them defined somewhere in the bridgetown files?
I’d like to be able to put ```my-custom-language, but obviously would need to define the keywords, comments, etc somewhere.
@Audiobabble@community.bridgetown.pub We use Kramdown for Markdown conversion, which in turn uses Rogue. You can look through lexers it provides here: https://github.com/rouge-ruby/rouge/tree/master/lib/rouge/lexers
I wrote a very simple one for Serbea a while back…don’t ask me much about how it all works beyond that though! 😅 https://github.com/bridgetownrb/serbea/blob/main/lib/rouge/lexers/serbea.rb
Thanks, that’s just what I needed! Was digging through the jekyll docs regarding Kramdown but couldn’t seem to find any actual implementation in Ruby – your example is just the starting point I need. Many thanks.