Code Fences Highlighting Buttons Plugin

Hey guys,
I’ve created a plugin for Discourse, which adds additional code fences and syntax highlighting buttons to the composer toolbar.
The plugin, documentation and all future updates can be found here: GitHub - ThomDietrich/discourse-plugin-code-fences-buttons: Discourse Plugin: Code Fences Buttons (cfbtn)

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!

15 个赞

此插件在面板中停止显示图标。有人知道如何修复吗?

1 个赞

看起来 plugin.rb 文件没有指定所需的图标。在文件顶部附近应该包含类似以下的代码行:

register_svg_icon "icon-name" if respond_to?(:register_svg_icon)

这些在旧版本的 Discourse 中并不需要,但现在则是必需的。

我还发现,有些图标的名称会随时间发生变化,我推测这是由于 Font Awesome 方面的更新所致,这导致我的一些插件图标消失,直到我找到了它们的新名称。

2 个赞

图标问题已修复,插件确认再次正常运行:slight_smile:

2 个赞

插件很棒!

如果自定义按钮设置能接受逗号分隔的列表,并在编辑器中生成下拉菜单,那就太棒了。我希望能在那里包含多种语言 :slight_smile: