إضافة علامة Discourse

discourse-mark

المستودع: GitHub - sirideain/discourse-mark: Adds highlighting to Discourse · GitHub

الميزات

  • يضيف خيارًا في المحرر لتظليل النص.

الاستخدام

يمكنك تغليف النص بـ == لتظليله.

==النص المظلل==

التثبيت

المشاكل المعروفة

  • لا يوجد

المستقبل

  • تحديث الأيقونة إلى قلم تظليل بمجرد توفر Font Awesome 5
27 إعجابًا

This is already sort of possible in default Discourse with HTML tags

inserted text and deleted text

<ins>inserted text</ins> and <del>deleted text</del>

Not quite the same as “highlighted” but a very similar effect at least for <ins>

10 إعجابات

I think @sirideain put this together following this thread: Discourse CommonMark text highlighting?

إعجابَين (2)

Yes totally fine, just pointing out there’s an alternative “sort-of” way to do this built in. I don’t think Commonmark even specifies highlight as part of the standard…

إعجاب واحد (1)

I think they’re fundamentally different things though? Insertions and deletions may be used in parallel with highlighting.

That’s a very literal reading. If I was to tell you I just highlighted this text how would anyone reading even know any different? Particularly if I changed the CSS to whatever color and style I liked…

إعجابَين (2)

Highlighting indicates areas for attention, insertions and deletions indicate change.

Sure, we can use CSS to restyle elements, we could also for example set background-color on anything within <strong> tags, but then we would lose the ability to make things bold without also highlighting them. The plugin lets us highlight passages without losing differentiation between the styles associated with tracked changes. Being a totally optional plugin which expands upon a well-established convention I don’t see tremendous value in confusing the two.

إعجاب واحد (1)

It is not part of the commonmark spec, that is for sure.

It would be great if this followed other common Markdown highlight syntax. I’m not sure if it’s in a particular spec (a quick Google search didn’t yield anything), but popular Markdown apps with the highlight feature use double colons to enclose text, like so:

::Highlighted Text::

Love the idea though!

إعجابَين (2)

Discourse is using markdown-it for parsing markdown. I am bundling the markdown-it-mark plugin so it is available in Discourse. Support for this syntax would need to be added there.

5 إعجابات

I installed this, and the ==text== highlighting works, but the Highlight Text option does not show up in the gear menu.

Curiously the Green Tick does not show next to the plugin either:

but I don’t know if that is related.

The green tick will only appear next to official plugins that are supported by the core discourse team, to distinguish them from 3rd party plugins.

6 إعجابات

There was an issue where the highlighting was not respecting the enable setting, but the gear menu option was. This has been fixed now.

This plugin appears to break posting in Discourse 2.6. At least, posting failed with error 500 until I removed this plugin and rebuilt my forum.

I just tested with a fresh install of 2.7 beta1 and it seems to be working correctly. What other plugins do you have installed? Is there anything in the Discourse logs?

See:

It is possible the rebuild was all that was required, though the error logs do mention markdown.

The other plugins are all Discourse first party ones.

I tried adding in the other plugins you listed and I was not able reproduce the issue.

I am not surprised the logs listed markdown as that is used for all formatting in Discourse posts. I didn’t see any mention of this plugin in the logs you posted.

What happens if you add the plugin back in and rebuild again? I think your idea that it was the rebuild is accurate.

I will try that and get back to you. I might not be able to get it done today, I need to do it when I have some time to track it carefully.

Thanks for the feedback.

I reinstalled the mark plugin and everything seems fine, so some combination of removing the plugin and rebuilding resolved the inability to post, and reinstalling the plugin and rebuilding did not return to the failure state.

Who knows what that means, but I’m happy to have the plugin back.

Thanks.

هل توجد طريقة لإضافة اختصارات التنسيق إلى شريط أدوات محرر المنشور؟ هناك عدد من الوسوم التي من شأنها تحسين فهم المواضيع التقنية. لكن المبتدئين، من ناحية أخرى، يشعرون بالإحباط بسبب بساطة شريط أدوات Discourse.

ربما يمكننا إضافة خيارات في شريط الأدوات لبعض وسوم Markdown التي يمكننا استخدامها لجعل منشوراتنا أكثر قابلية للقراءة. مثالك على إدراج و حذف عملي جدًا. هذا بالإضافة إلى وسم زر لوحة المفاتيح يوضح بالفعل منشوراتنا من قبل المستخدمين المنتظمين ذوي الخبرة.

وبما أننا نقدم دعمًا برمجيًا مدعومًا من المجتمع، فإن مجموعة إيموجي قابلة للتخصيص (مُعلَّقة في الأعلى/كافتراضي) ستكون مفيدة. (سنضيف مجموعة إيموجي التكنولوجيا.)

كود مُدرج : <ins>كود مُدرج</ins>
كود محذوف : <del>كود محذوف</del>
نص مُحدَّد : <mark>نص مُحدَّد</mark>
مفاتيح لوحة المفاتيح Ctrl+k : <kbd>Ctrl</kbd>+<kbd>k</kbd>

تشمل إيموجي التكنولوجيا أجهزة الإدخال مثل الفأرة ولوحة المفاتيح.
:computer_mouse: فأرة الحاسوب

4 إعجابات