إضافة علامة 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.

يبدو أن هذه الإضافة تسبب خللاً في النشر على Discourse 2.6. على الأقل، فشل النشر مع خطأ 500 حتى قمت بإزالة هذه الإضافة وإعادة بناء المنتدى.

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

انظر:

من الممكن أن يكون إعادة البناء هو كل ما كان مطلوبًا، على الرغم من أن سجلات الأخطاء تذكر markdown.

الإضافات الأخرى هي جميعها من إنتاج Discourse الأصلي.

لقد حاولت إضافة الإضافات الأخرى التي أدرجتها، ولم أتمكن من إعادة إنتاج المشكلة.

لا يُفاجئني أن السجلات تذكر Markdown، حيث يُستخدم لتنسيق جميع منشورات Discourse. لم أرَ أي ذكر لهذه الإضافة في السجلات التي شاركتها.

ماذا يحدث إذا أضفت الإضافة مرة أخرى وقمت بإعادة البناء مرة أخرى؟ أعتقد أن فكرتك بأن المشكلة كانت في عملية إعادة البناء دقيقة.

سأجرب ذلك وأعود إليك. قد لا أستطيع إنجاز ذلك اليوم، أحتاج إلى القيام بذلك عندما أملك بعض الوقت لتتبعه بعناية.

شكرًا على ردود الفعل.

أعدت تثبيت إضافة mark، ويبدو أن كل شيء على ما يرام، لذا فإن مزيجًا من إزالة الإضافة وإعادة البناء قد حل مشكلة عدم القدرة على النشر، ولم يؤدي إعادة تثبيت الإضافة وإعادة البناء إلى العودة إلى حالة الفشل.

من يدري ما يعنيه ذلك، لكنني سعيد بعودة الإضافة.

شكرًا لك.

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

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

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

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

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

4 إعجابات