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 beta1 的全新安装上进行了测试,似乎运行正常。您还安装了哪些其他插件?Discourse 日志中有任何记录吗?
参见:
可能只需执行重建操作即可解决问题,不过错误日志中确实提到了 markdown。
其他插件均为 Discourse 官方插件。
我尝试添加了您列出的其他插件,但未能复现该问题。
日志中列出 markdown 并不令人意外,因为 Discourse 帖子中的所有格式都使用它。但我没有在您提供的日志中看到任何关于此插件的提及。
如果您重新添加该插件并再次重建,会发生什么?我认为您关于问题出在重建步骤上的判断是准确的。
我会尝试一下并回复你。我今天可能无法完成,我需要找些时间仔细排查。
感谢反馈。
我重新安装了 mark 插件,一切似乎都正常了。看来,移除插件并重新构建的组合操作解决了无法发帖的问题,而重新安装插件并再次重新构建后,并未回到故障状态。
谁知道这意味着什么,但我很高兴插件又回来了。
谢谢。
有没有办法为帖子编辑器的工具栏添加样式快捷方式?有许多标签可以提升技术主题的可理解性。但另一方面,新手可能会因 Discourse 工具栏的简朴而感到沮丧。
或许我们可以为一些能提升帖子可读性的 Markdown 标签提供工具栏选项。您提到的 插入 和 删除 就非常实用。再加上 键盘按钮 标签,已经能帮助经验丰富的常客更清晰地表达内容。
此外,鉴于我们提供的是社区驱动的软件支持,一个可自定义的表情符号组(默认置顶)会很有帮助。(我们可以添加一个技术类表情符号组。)
插入的代码:<ins>插入的代码</ins>
删除的代码:<del>删除的代码</del>
标记的文本:<mark>标记的文本</mark>
键盘按键 Ctrl+k:<kbd>Ctrl</kbd>+<kbd>k</kbd>
技术类表情符号包括鼠标和键盘等输入设备。
电脑鼠标