The Code Fences Highlighting Buttons Plugin, created by Mazzen, adds extra code fences and syntax highlighting buttons to the Discourse composer toolbar. The plugin’s settings allow users to configure the available buttons, and options are easily extendable.
An issue with the plugin’s icons not showing in the panel was reported by AGulev, but LeoDavidson suggested a solution by adding lines to the plugin.rb file to specify the required icons. Mazzen confirmed that the issue has been fixed.
ssvenn suggested a feature enhancement, proposing that the custom button setting accept a comma-separated list to generate a dropdown menu for the button in the editor, allowing for multiple languages to be included.
The available buttons in your toolbar are configured through the plugin settings. Currently there is one javascript option and one with free to choose syntax highlighting. Options are easily extendable, just duplicate one of the two. Pull requests welcome!
Похоже, что файл plugin.rb не указывает необходимые иконки. В верхней части файла должны быть строки вроде этой:
register_svg_icon "icon-name" if respond_to?(:register_svg_icon)
Ранее в старых версиях Discourse это не требовалось, но теперь это необходимо.
Также я обнаружил, что названия некоторых иконок со временем меняются, вероятно, из-за обновлений в Font Awesome. Из-за этого иконки в моих плагинах исчезали, пока я не находил их новые названия.
Было бы здорово, если бы настройка пользовательской кнопки позволяла указывать список через запятую, который создавал бы выпадающее меню для кнопки в редакторе. Я бы с радостью добавил туда целый набор языков