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: