Closed martijnversluis closed 3 years ago
Hi I would be willing to take this on and issue PRs. As I understand it this ticket means we want the option to display meta data in the output by allowing the formatters to optionally display them.
What API do you suggest? How about an option object passed to the formatter that indicates what meta data we want included:
{capo: true, ...}
etc.
Hi @kahunacohen. Thanks for offering your help on this! ๐
The functionality described in this issue is actually a bit different from what you're suggesting, but I would love to have both implemented:
rendering meta data like capo, key, author etc inside the header of the chord sheet.
using metadata inside the chord sheet lyrics (https://www.chordpro.org/chordpro/ChordPro-Configuration-Format-Strings.html). That will probably require some preprocessing before parsing the chord sheet. Besides that, I got stuck implementing that in the current parsing. I might be better to use a parser generator to develop a whole new parsing that also support the metadata tags.
Which one of this were you planning to pick up?
The API you suggest for rendering (in the header I assume?) seems logical. Something like:
formatter.format(song, {
metadata: {
capo: true,
key: true
}
});
or perhaps using an array:
formatter.format(song, {
metadata: ['capo', 'key']
});
I'm available for discussion about or help on implementing this, thanks for reaching out!
Not super familiar with chordpro spec. My use-case is that I want meta data like capo rendered in the output. I assume in the beginning, so the header I guess. I assume for HTML this would output classes or ids so the end user can style as they see fit.
I like using the array better than my idea.
My use-case is that I want meta data like capo rendered in the output. I assume in the beginning, so the header I guess. I assume for HTML this would output classes or ids so the end user can style as they see fit.
Agree, sounds like a plan ๐
I like using the array better than my idea.
Cool ๐
Do you need something from me to get started?
Nope, gonna for for it as soon as I get a chance.
Taking a look at the simple text formatter. How for example should capo be? As simple as this?
Also do we really need to pass a meta data object to formatter? Why not just always output all metadata, or are there enough use-cases where users might not want specific pieces of metadata in their output?
LET IT BE
ChordSheetJS example version
Capo: 3
Bridge
Am C/G F C
Let it be, let it be, let it be, let it be
C F G F C/E Dm C
Whisper words of wisdom, let it be
Am Bb F C
Whisper words of wisdom, let it be
@kahunacohen Jep, this looks fine by me. I think displaying it should be configurable as it otherwise might break peopleโs apps. But we can simplify at first it by just exposing one config option? Something like renderMetadata
?
Hi, after looking into my project needs I decided to go with Django on the back-end so will either be looking for solutions or building my own python solution. I just can't find a nodejs backend framework that gives me what I want. Thanks.
https://web.archive.org/web/20181124024446/http://www.chordpro.org:80/chordpro/ChordPro-Configuration-Format-Strings.html