function stageWork({title, roles}) {
return `<!--stageWork() in _includes/shortcodes/corpus.js-->
<li>
<em>${title}</em>
(${roles.map(role => `${role}`).join(', ')})
</li>`
}
function concertWork({largerWork, opusNumber, title}) {
return `<!--concertWork() in _includes/shortcodes/corpus.js-->
<li>
${title.charAt(0) === '“'
? `${title}${largerWork ? ` from <em>${largerWork}</em>` : ''}${opusNumber ? `, ${opusNumber}` : ''}`
: `<em>${title}</em>${opusNumber ? `, ${opusNumber}` : ''}`
}
</li>`
}
export default ({name: composer, works}) => `<!--_includes/shortcodes/corpus.js-->
<article>
<h3>${composer}</h3>
<ul>
${works.map(work =>
work.hasOwnProperty('roles')
? stageWork(work)
: concertWork(work)
).join('\n')}
</ul>
</article>`