feat: render comments as Markdown

Labels: area/comments kind/feature lifecycle/stale priority/awaiting-more-evidence triage/needs-information

Timeline

Michael Muré (MichaelMure) opened

For now, comments are rendered in the CLI and termUI as pure text. It would be neat to have markdown instead.

While it's easy to find a renderer that output HTML, finding one that render as text or even better text formatted with terminal escape sequence is more tricky.

Need some investigation.

Michael Muré (MichaelMure) added label enhancement

Michael Muré (MichaelMure) added label RFC

Jed Fox (j-f1) commented

Looks like there are 2 Go implementations of CommonMark. I couldn’t find anything in Go to convert Markdown to ANSI codes, but I did find this Node library. Alternatively, since Markdown tries to be human-readable, it could be output as-is on terminals. Support could eventually be added to style bold/italics as they’re supposed to be styled while fading out the */_ delimiters. Similar things could be done for inline code (fade out the `) and code blocks (fade out the ``` and syntax-highlight the code based on the language tag).

andyl (andyl) commented

We would also like Markdown comments.

For extra credit: it would be nice to have a markdown 'templating' way to dynamically render meta-data variables (like $issue_id, $issue_labels, $issue_title, $issue_status).

![Status PNG](http://mywebhost/status.png?issue_id={{$issue_id}}&issue_status={{$issue_status}})

Michael Muré (MichaelMure) commented

I started working on this: image

It's in the termui-markdown branch, but not bolted in the termui yet.

Michael Muré (MichaelMure) commented

With #150, we now have markdown rendering in the webUI. Thanks @sandhose !

Michael Muré (MichaelMure) commented

@ProgramFan I currently writing a Markdown renderer for the terminal. This renderer use the util/text that you rewrote to fix my broken code. Ideally, this renderer would be integrated upstream to the blackfriday project, but this require to re-license your code as well. Would you agree to re license it to the MIT license ?

ProgramFan (ProgramFan) commented

No problem with MIT.

ProgramFan (ProgramFan) commented

Nice to see that :smile:

Michael Muré notifications@github.com 于2019年7月15日周一 上午8:06写道:

@ProgramFan https://github.com/ProgramFan I published the text package as a standalone package here: https://github.com/MichaelMure/go-term-text

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MichaelMure/git-bug/issues/12?email_source=notifications&email_token=AAAH5DHYICCC4G6MEPBDTCLP7O5PVA5CNFSM4FPKJVQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ4QAIQ#issuecomment-511246370, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAH5DG7XE63TPWWPLAEPPLP7O5PVANCNFSM4FPKJVQQ .

github-actions (github-actions) commented

This bot triages untriaged issues and PRs according to the following rules:

  • After 90 days of inactivity, the lifecycle/stale label is applied
  • After 30 days of inactivity since lifecycle/stale was applied, the issue is closed

To remove the stale status, you can:

  • Remove the lifecycle/stale label
  • Comment on this issue

github-actions (github-actions) added label lifecycle/stale

sudoforge removed label enhancement

sudoforge removed label RFC

sudoforge removed label lifecycle/stale

sudoforge added label kind/feature

sudoforge added label area/comments

sudoforge added label triage/needs-priority

sudoforge added label triage/needs-information

sudoforge removed label triage/needs-priority

sudoforge added label priority/awaiting-more-evidence

github-actions (github-actions) commented

This bot triages issues in order to help the maintainers identify what needs attention, according to the following lifecycle rules:

  • After 90 days of inactivity, lifecycle/stale is applied
  • After 90 days of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied

This bot will not automatically close stale issues.

To remove the stale status, you can:

  • Remove the stale label from this issue
  • Comment on this issue
  • Close this issue
  • Offer to help out with triaging

To avoid automatic lifecycle management of this issue, add lifecycle/frozen.

github-actions (github-actions) added label lifecycle/stale

github-actions (github-actions) removed label lifecycle/idle