Skip to content

Commit

Permalink
🔨 incorporate feedback from Este - simplify metadata and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
danyx23 committed Aug 12, 2024
1 parent 5a4d18f commit 4549ceb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 26 deletions.
19 changes: 13 additions & 6 deletions functions/_common/grapherRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,14 +360,22 @@ export async function fetchMetadataForGrapher(
undefined
)

const titleShort = col.titlePublicOrDisplayName.title
const attributionShort = col.titlePublicOrDisplayName.attributionShort
const titleVariant = col.titlePublicOrDisplayName.titleVariant
const attributionString =
attributionShort && titleVariant
? `${attributionShort}${titleVariant}`
: attributionShort || titleVariant
const titleModifier = attributionString ? ` - ${attributionString}` : ""
const titleLong = `${col.titlePublicOrDisplayName.title}${titleModifier}`

return [
useShortNames ? shortName : col.name,
{
title: col.titlePublicOrDisplayName.title,
titleProducer: col.titlePublicOrDisplayName.attributionShort,
titleVariant: col.titlePublicOrDisplayName.titleVariant,
titleShort,
titleLong,
descriptionShort,
descriptionFromProducer,
descriptionKey,
descriptionProcessing,
shortUnit,
Expand All @@ -377,14 +385,13 @@ export async function fetchMetadataForGrapher(
type,
conversionFactor: col.display?.conversionFactor,
owidVariableId,
catalogPath,
sources: consensedOrigins,
shortName,
additionalInfo,
lastUpdated,
nextUpdate,
citationShort,
citationLong,
fullMetadata: `https://api.ourworldindata.org/v1/indicators/${owidVariableId}.metadata.json`,
},
]
})
Expand Down
23 changes: 3 additions & 20 deletions functions/_common/readmeTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,24 +153,6 @@ export function* getSources(
if (source.retrievedFrom)
yield `Retrieved from: ${source.retrievedFrom.trim()}` +
markdownNewlineEnding
if (source.description) {
yield ""
yield "##### Description of the dataset"
yield* yieldMultilineTextAsLines(source.description).map(
(l) => `> ${l}`
)
yield ""
}
if (source.citation) {
yield ""
yield "##### Citation"
yield "This is the citation of the original data obtained from the source, prior to any processing or adaptation by Our World in Data. We would usually prefer to use the Our World In Data citation format given at the bottom." +
markdownNewlineEnding
yield* yieldMultilineTextAsLines(source.citation).map(
(l) => `> ${l}`
)
yield ""
}
}
}

Expand Down Expand Up @@ -234,15 +216,16 @@ function* columnReadmeText(col: CoreColumn) {
const attribution = getAttribution(def)

const source = getSource(attribution, def)

yield* getCitationLines(def, col)

yield `Source: ${source}`

yield* getDescriptionLines(def, attribution)

yield* getSources(def)

yield* getDataProcessingLines(def)

yield* getCitationLines(def, col)
yield ""
}

Expand Down

0 comments on commit 4549ceb

Please sign in to comment.