discourse-mark
リポジトリ: GitHub - sirideain/discourse-mark: Adds highlighting to Discourse · GitHub
機能
- テキストをハイライトするためのエディターオプションを追加します。
使用方法
テキストを==で囲むとハイライトされます。
==ハイライトされたテキスト==
インストール
既知の問題
- なし
今後の予定
- Font Awesome 5 が利用可能になったら、アイコンをハイライターに変更します
リポジトリ: GitHub - sirideain/discourse-mark: Adds highlighting to Discourse · GitHub
テキストを==で囲むとハイライトされます。
==ハイライトされたテキスト==
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>
I think @sirideain put this together following this thread: Discourse CommonMark text highlighting?
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…
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…
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.
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!
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.
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.
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 ベータ版を新規インストールしてテストしたところ、問題なく動作しているようです。他にどのようなプラグインをインストールしていますか?Discourse のログに何か記録はありますか?
参照:
再構築が唯一必要な対応だった可能性もありますが、エラーログには Markdown に関する言及が含まれています。
他のプラグインはすべて Discourse 公式のプラグインです。
追加した他のプラグインを試してみましたが、問題の再現はできませんでした。
Discourse の投稿ではすべての書式設定に Markdown が使用されるため、ログに Markdown が記載されていても驚きではありません。ただし、投稿されたログにはこのプラグインに関する言及は見当たりませんでした。
プラグインを再度追加して、再度ビルドするとどうなりますか?再ビルドが原因だったというあなたの考えは正しいと思います。
試して結果を報告します。今日はできないかもしれません。慎重に追跡できる時間が取れたときに行う必要があります。
フィードバックをありがとうございます。
mark プラグインを再インストールしたところ、すべて正常に動作しているようです。プラグインの削除と再構築の組み合わせにより、投稿できない状態が解消され、プラグインの再インストールと再構築を行っても、再び失敗状態には戻りませんでした。
それが何を意味するのかは誰にもわかりませんが、プラグインが戻ってきて嬉しいです。
ありがとうございました。
投稿エディタのツールバーに、スタイル設定のショートカットを追加する方法はありますか?技術的なトピックの理解を深めるのに役立つタグは数多くあります。一方で、初心者にとっては、Discourse のツールバーの簡素さに不満を感じることもあります。
おそらく、投稿の可読性を高めるために使用できるいくつかの Markdown タグ用のツールバーオプションを用意できるでしょう。あなたの例である 挿入 と 削除 は非常に実用的です。これに、キーボードボタン タグを加えることで、経験豊富な常連による投稿がさらに明確になります。
また、コミュニティ主導のソフトウェアサポートを行っている以上、カスタマイズ可能な絵文字グループ(トップまたはデフォルトに配置)があると便利です。(技術関連の絵文字グループを追加します。)
挿入されたコード : <ins>挿入されたコード</ins>
削除されたコード : <del>削除されたコード</del>
マークされたテキスト : <mark>マークされたテキスト</mark>
キーボードキー Ctrl+k : <kbd>Ctrl</kbd>+<kbd>k</kbd>
技術関連の絵文字には、マウスやキーボードなどの入力デバイスも含まれます。
コンピュータマウス