From 174dbc87a6bc4c65b0bc20114f49279cb803443a Mon Sep 17 00:00:00 2001 From: Chris Wilkinson Date: Tue, 7 Jan 2025 16:31:23 +0000 Subject: [PATCH] Make it easier to add new words at the beginning of titles Refs #261 --- src/reviews.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/reviews.md b/src/reviews.md index b2060cb..f345f56 100644 --- a/src/reviews.md +++ b/src/reviews.md @@ -7,6 +7,8 @@ toc: false # PREreviews ✍️ ```js +import { capitalize } from 'npm:effect/String' + const parseDate = d3.utcParse('%Y-%m-%d') const languageNames = new Intl.DisplayNames(['en-US'], { type: 'language' }) const languageName = code => (code ? languageNames.of(code) : 'Unknown') @@ -97,7 +99,9 @@ const languageColor = Plot.scale({ }, }) -const title = `${chosenCollaborative ? 'Collaborative ' : ''}${chosenRequest ? (chosenCollaborative ? 'requested ' : 'Requested ') : ''}${chosenType ? reviewType(chosenType) : ''} PREreviews${chosenPseudonym ? ' using a pseudonym' : ''}` +const title = capitalize( + `${chosenCollaborative ? 'collaborative ' : ''}${chosenRequest ? 'requested ' : ''}${chosenType ? reviewType(chosenType) : ''} PREreviews${chosenPseudonym ? ' using a pseudonym' : ''}`, +) const titleWithYear = `${title} ${chosenYear ? ` in ${chosenYear}` : ''}` ```