From 6f7b9b1ebf78039d6ed197b88d0c50dbe7082cd7 Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Mon, 14 Jul 2025 13:43:26 +0300 Subject: [PATCH] code highligh --- app/views/api_settings/index.html.erb | 6 +++--- config/initializers/rouge.rb | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/api_settings/index.html.erb b/app/views/api_settings/index.html.erb index 7defd3c2..c5a761a8 100644 --- a/app/views/api_settings/index.html.erb +++ b/app/views/api_settings/index.html.erb @@ -53,7 +53,7 @@ <%= render 'shared/clipboard_copy', icon: 'copy', text:, class: 'btn btn-ghost text-white', icon_class: 'w-6 h-6 text-white', copy_title: t('copy'), copied_title: t('copied') %> -
<%= text %>
+
<%== HighlightCode.call(text, 'Shell', theme: 'base16.dark') %>
@@ -79,7 +79,7 @@ <%= render 'shared/clipboard_copy', icon: 'copy', text:, class: 'btn btn-ghost text-white', icon_class: 'w-6 h-6 text-white', copy_title: t('copy'), copied_title: t('copied') %> -
<%= text %>
+
<%== HighlightCode.call(text, 'Shell', theme: 'base16.dark') %>
@@ -101,7 +101,7 @@ <%= render 'shared/clipboard_copy', icon: 'copy', text:, class: 'btn btn-ghost text-white', icon_class: 'w-6 h-6 text-white', copy_title: t('copy'), copied_title: t('copied') %> -
<%= text %>
+
<%== HighlightCode.call(text, 'Shell', theme: 'base16.dark') %>
diff --git a/config/initializers/rouge.rb b/config/initializers/rouge.rb index bf00d89a..e2c69ce7 100644 --- a/config/initializers/rouge.rb +++ b/config/initializers/rouge.rb @@ -8,6 +8,7 @@ module Rouge module Lexers autoload :JSON, 'rouge/lexers/json' + autoload :Shell, 'rouge/lexers/shell' end autoload :Formatter, 'rouge/formatter'