Implementing Markdown for m30pm CLI to Format Output #36
Replies: 2 comments
-
Well, I thought this project was being actively maintained, but upon testing some things and digging a little deeper, it looks like it is semi-abandoned. Open issues have been in the project for years (nested list issue), including one I ran into in the demo files. Plus there are other issues I am finding that are also showing up (strange block quote issue, also turned up from demo files). That being said, this is the most complete package like this and the things that work, work well. I think we should use the library with settings configured to minimize impact of bugs and then later determine if we want to invest any other time in dealing with those bugs. I will see if I can create a good demo case for our kind of output and then make a recommendation about settings to use. |
Beta Was this translation helpful? Give feedback.
-
A first pass at settings (placing here for reference). var selectedOptions = {
blockquote: chalk.visible,
html: chalk.visible,
heading: chalk.green.bold,
firstHeading: chalk.green.underline.bold,
codespan: chalk.bgGray,
del: chalk.gray.strikethrough,
link: chalk.blueBright,
href: chalk.blueBright.underline,
unescape: true,
emoji: false,
width: 80,
showSectionPrefix: false,
reflowText: true,
tab: 4,
tableOptions: {style: {head: ['bold', 'bgGrey']}}
};
var codeHighlightTheme = {theme: {
keyword: chalk.blueBright,
string: chalk.redBright,
literal: chalk.blueBright,
default: chalk.grey
}}
// Example showing usage information from a CLI tool.
marked.use(markedTerminal(selectedOptions, codeHighlightTheme)) |
Beta Was this translation helpful? Give feedback.
-
Markdown is ubiquitous. It is supported by many of the view generation tools we have investigated. It is supported in larger fields in LinkML like description. So, I propose that we use Markdown to format output in the m30pm CLI.
Specifically, I think we should try using the marked-terminal package. It has support for tables, code blocks, and just about everything else we could ever want. I will be testing it out and posting results to this thread.
Beta Was this translation helpful? Give feedback.
All reactions