Similar module by me
finnp opened this issue · 3 comments
Hey there,
for some reason I didn't see your project and just wrote basically the same module (only that I expose marked and not the renderer): https://github.com/finnp/cli-md
You should check out the https://www.npmjs.org/package/cardinal module, which has javascript terminal syntax highlighting.
Maybe if we change your module in being a little bit more customisable (for the colors e.g.) I would use your renderer in my module. This way we wouldn't have the code duplication, but I could still use my own color skin or whatever.
Best,
Finn
Hi! Yeah, that's a great idea. I could easily make the Renderer-constructor take an options object defining different colors for different sections. I'm all for keeping the node eco-system as concise as possible.
How about something like
new TerminalRenderer({
code: chalk.yellow,
quote: chalk.italic.gray,
heading: function () {
// possible a custom function
}
})
But with defaults, so you could just do
new TerminalRenderer()
Thanks for the tip about cardinal! I'll check it out.
Yes exactly like this :)
I've added support for this and published the module as version 1.0.0
on NPM.
Thanks for your help!