dart-lang / markdown

A Dart markdown library
https://pub.dev/packages/markdown
BSD 3-Clause "New" or "Revised" License
443 stars 201 forks source link

ansi color support for terminal cli #503

Open laoshaw opened 1 year ago

laoshaw commented 1 year ago

this converts to html like golang's chroma,which is based off pygmentize,can this package support colors in terminal programs too?

srawlins commented 1 year ago

Can you explain what feature would you like? What markdown text would result in what HTML text?

Note that we stick pretty tightly to CommonMark specification, which I believe does not support and ANSI color syntax.

laoshaw commented 1 year ago

would like to convert markdown(commonmark is perfectly fine) to ansi-color output inside a terminal, e.g. dartless my.md can render markdown file with color for me to read at command line. dartless is a less command alternative written in dart, something like bat in rust, that I want to write. Thanks.

srawlins commented 1 year ago

I see. Sorry we don't support anything like this. We intend to support a public, stable, syntax tree for Markdown nodes. Then you could, for example, render that tree as ANSI codes. https://github.com/dart-lang/markdown/issues/369