Plugin Discourse Mark

discourse-mark

Repositório: GitHub - sirideain/discourse-mark: Adds highlighting to Discourse · GitHub

Recursos

  • Adiciona uma opção no editor para destacar texto.

Uso

Você pode envolver o texto com == para destacá-lo.

==Texto Destacado==

Instalação

Problemas Conhecidos

  • Nenhum

Futuro

  • Atualizar o ícone para um marca-texto assim que o Font Awesome 5 estiver disponível
27 curtidas

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 curtidas

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

2 curtidas

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 curtida

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 curtidas

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 curtida

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 curtidas

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 curtidas

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 curtidas

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

Este plugin parece quebrar a postagem no Discourse 2.6. Pelo menos, a postagem falhou com erro 500 até que eu removesse este plugin e reconstruísse meu fórum.

Acabei de testar com uma instalação limpa da versão 2.7 beta1 e parece estar funcionando corretamente. Quais outros plugins você tem instalados? Há algo nos logs do Discourse?

Veja:

É possível que apenas a reconstrução tenha sido necessária, embora os logs de erro mencionem markdown.

Os outros plugins são todos nativos do Discourse.

Tentei adicionar os outros plugins que você listou e não consegui reproduzir o problema.

Não me surpreende que os logs mencionem markdown, pois ele é usado para toda a formatação nos posts do Discourse. Não vi nenhuma menção a este plugin nos logs que você enviou.

O que acontece se você adicionar o plugin novamente e reconstruir? Acredito que sua ideia de que o problema estava na reconstrução está correta.

Vou tentar isso e retorno para você. Talvez não consiga fazer isso hoje; preciso fazê-lo quando tiver algum tempo para acompanhar com cuidado.

Obrigado pelo feedback.

Reinstalei o plugin mark e tudo parece estar funcionando bem. Então, alguma combinação de remover o plugin e reconstruir resolveu a impossibilidade de postar, e reinstalar o plugin e reconstruir não fez o sistema voltar ao estado de falha.

Quem sabe o que isso significa, mas estou feliz em ter o plugin de volta.

Obrigado.

Existe alguma maneira de adicionar atalhos de estilo à barra de ferramentas do editor de postagens? Há várias tags que melhorariam a compreensão de tópicos técnicos. Por outro lado, os novatos ficam frustrados com a austeridade da barra de ferramentas do Discourse.

Talvez pudéssemos ter opções na barra de ferramentas para algumas tags Markdown que podemos usar para tornar nossas postagens mais legíveis. Seu exemplo de Inserir e Remover é muito prático. Isso, junto com a tag teclado, já esclarecem nossas postagens feitas por usuários experientes.

E como estamos fazendo suporte a software impulsionado pela comunidade, um grupo de emojis personalizável (flutuando no topo/padrão) seria útil. (Adicionaríamos um grupo de emojis de tecnologia.)

código inserido: <ins>código inserido</ins>
código removido: <del>código removido</del>
texto marcado: <mark>texto marcado</mark>
Teclas de teclado Ctrl+k: <kbd>Ctrl</kbd>+<kbd>k</kbd>

Emojis de tecnologia incluem dispositivos de entrada, como mouse e teclado.
:computer_mouse: Mouse de computador

4 curtidas