no-chris / chord-symbol

The definitive chord symbol parser and renderer for Javascript/NodeJS.
https://chord-symbol.netlify.app
MIT License
174 stars 8 forks source link

Allow more rendering options #290

Closed ecstrema closed 4 years ago

ecstrema commented 4 years ago

In bb-format, I wanted to render minor chords as with a "-" instead of a "mi" so I added a search-and-replace for it. image

However, it is not the only that might want to have even shorter options (like Delta for Maj7), I thought I might as well add these options directly in this lib instead of post-processing it.

So here's the question: how should that be done? Should I:

Thanks

no-chris commented 4 years ago

Wow, that looks amazing! Great job 👏

Option 3 is preferred to keep the API clean. It's actually a feature I wanted to add for some time and I've been working on it during the last few days: https://github.com/no-chris/chord-symbol/pull/292

The idea here would be to add a rendering filter to customise the rendering to your taste. You could either:

That was the initial idea behind the library: there is an opinionated default rendering, but the normalised chord object allows a user to bypass it and tailor every part of the rendering as he prefers

Would this cover your need?

ecstrema commented 4 years ago

Ok, seems perfect! Then I'll use #292.

no-chris commented 4 years ago

You can use directly the v1.1.0 branch

Let me know if it works fine so we can close the issue.

ecstrema commented 4 years ago

Works as a charm.

no-chris commented 4 years ago

Great ! Let's release then! 🚀