Public
Edited
Mar 16
Paused
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
entries = parseChangelog(await fetch(url).then(r => r.text()))
Insert cell
entriesInRange = !versionRange ? entries : entries.filter(d => d.version && semver.satisfies(d.version, versionRange))
Insert cell
params = Object.fromEntries(new URL(document.baseURI).searchParams)
Insert cell
Insert cell
Insert cell
semver = (await import("https://esm.sh/semver@7.7.1")).default
Insert cell
function parseChangelog(text) {
let version = null;
let category = null;
const entries = [];
for(const line of text.split(/\n+/).filter(d => d.trim())) {
switch(line.match(/^[^ ]+ /)?.[0]) {
case "# ": continue;
case "## ": version = line.slice(3); category = null; continue;
case "### ": category = line.slice(4); continue;
case "- ": {
const _line = line.slice(2);
const split = _line.match(/^[a-z\s]+: /)?.[0].length;
const type = split ? _line.slice(0, split - 2).trim() : null;
const content = split ? _line.slice(split) : _line;
entries.push({version, category, type, content});
break;
}
default:
entries.push({version, category, type: null, content: line});
}
}
return entries;
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more