jevstrudel.git / website / src / jev / songCode.mjs

A song's code as the page plays it: song.js with a // @title line first when it has none (the REPL titles the tab from it, metadata_parser.js), so the title lives only in SPEC.md. One source for the song index (songs.mjs) and for anything that must match the code a listener heard, such as a performance's code hash (tools/jev-history/).

6export const songCode = (raw, title) => (raw && !/@title\b/.test(raw) ? `// @title ${title}\n${raw}` : raw);