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 curtidas

Este plugin parou de exibir ícones no painel. Alguém sabe como corrigir isso?

2 curtidas

Parece que o arquivo plugin.rb não está especificando os ícones de que precisa. Deve haver linhas como esta perto do topo:

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

Essas linhas não eram necessárias em versões mais antigas do Discourse, mas agora são.

Também descobri que alguns nomes de ícones mudam com o tempo, provavelmente devido a alterações no lado do Font Awesome, o que fez com que alguns dos ícones dos meus próprios plugins desaparecessem até que eu encontrasse os novos nomes para eles.

2 curtidas

O problema com os ícones foi corrigido e o plugin foi confirmado como funcionando novamente :slight_smile:
https://github.com/ThomDietrich/discourse-plugin-code-fences-buttons/pull/5

2 curtidas

Ótimo plugin!

Seria legal se a configuração do botão personalizado aceitasse uma lista separada por vírgulas que gerasse um menu suspenso para o botão no editor. Adoraria ter uma variedade de idiomas lá :slight_smile: