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개의 좋아요

이 플러그인이 패널에 아이콘을 표시하지 않습니다. 이 문제를 해결하는 방법을 아시는 분이 계신가요?

2개의 좋아요

plugin.rb 파일에서 필요한 아이콘을 지정하지 않은 것 같습니다. 파일 상단에 다음과 같은 줄이 있어야 합니다:

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

이전 버전의 Discourse에서는 이 지정이 필요하지 않았지만, 이제는 필요합니다.

또한 아이콘 이름이 시간이 지남에 따라 변경되는 경우도 발견했습니다. 아마도 Font Awesome 측의 변경 사항 때문일 텐데, 이로 인해 제 플러그인 아이콘 중 일부가 사라졌다가 새 이름을 찾아내야 겨우 복구되는 일이 있었습니다.

2개의 좋아요

아이콘 문제가 수정되었고, 플러그인이 다시 정상적으로 작동하는 것이 확인되었습니다 :slight_smile:

2개의 좋아요

좋은 플러그인이네요!

커스텀 버튼 설정에서 쉼표로 구분된 목록을 받아서 에디터에서 버튼에 드롭다운 메뉴를 생성할 수 있다면 정말 좋을 것 같아요. 다양한 언어를 모두 넣을 수 있으면 좋겠습니다 :slight_smile: