add webhook events

This commit is contained in:
Alex Turchyn authored and Pete Matsyburka committed 2025-07-04 22:28:01 +03:00
1 parent 1b60b42428
commit 988a5361a6
54 files changed
+825 -160

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
# frozen_string_literal: true
module HighlightCode
module_function
def call(code, lexer, theme: 'base16.light')
require 'rouge/themes/base16' unless Rouge::Theme.registry[theme]
formatter = Rouge::Formatters::HTMLInline.new(theme)
lexer = Rouge::Lexers.const_get(lexer.to_sym).new
formatted_code = formatter.format(lexer.lex(code))
formatted_code = formatted_code.gsub('background-color: #181818', '') if theme == 'base16.dark'
formatted_code
end
end