Code Fences Highlighting Buttons Plugin

AI-generated summary

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.

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) · GitHub

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 Mi Piace

Questo plugin ha smesso di mostrare le icone nel pannello. Qualcuno sa come risolvere il problema?

2 Mi Piace

Sembra che il file plugin.rb non specifichi le icone di cui ha bisogno. Vicino all’inizio dovrebbero esserci righe come questa:

register_svg_icon "nome-icona" if respond_to?(:register_svg_icon)

Queste non erano necessarie nelle versioni più vecchie di Discourse, ma ora lo sono.

Ho anche notato che alcuni nomi delle icone cambiano nel tempo, probabilmente a causa di modifiche lato Font Awesome, il che ha fatto scomparire alcune delle mie icone dei plugin finché non ho trovato i nuovi nomi.

2 Mi Piace

Il problema con le icone è stato risolto, il plugin è di nuovo funzionante :slight_smile:

2 Mi Piace

Bellissimo plugin!

Sarebbe fantastico se l’impostazione del pulsante personalizzato potesse accettare un elenco separato da virgole che generi un menu a tendina per il pulsante nell’editor. Mi piacerebbe avere un’ampia gamma di lingue lì dentro :slight_smile: