Skip to content

Commit

Permalink
Include description into versions overview page
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Büchse <matthias.buechse@cloudandheat.com>
  • Loading branch information
mbuechse committed Nov 23, 2023
1 parent eb35899 commit d384a34
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions populateStds.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,13 @@ ${trackIntros[track]}
tlines.push('| --------- | ------------ | ---------------- |')
Object.entries(trackEntry[1]).forEach((standardEntry) => {
var versions = standardEntry[1].versions
var activeLinks = versions.filter((v) => v.isActive).map((v) => `[${v.version}](/standards/${v.id})`)
var description = versions[versions.length - 1].title
var icon = activeLinks.length ? '🟢' : '🟠'
var activeVersions = versions.filter((v) => v.isActive)
var activeLinks = activeVersions.map((v) => `[${v.version}](/standards/${v.id})`)
var ref = versions[versions.length - 1]
if (activeVersions.length) {
activeVersions[activeVersions.length - 1]
}
var icon = activeVersions.length ? '🟢' : '🟠'
var adrId = standardEntry[0]
var standardItem = {
type: 'category',
Expand All @@ -103,12 +107,17 @@ ${trackIntros[track]}
}
trackItem.items.push(standardItem)
var slines = readPrefixLines(`standards/${track.toLowerCase()}/scs-${adrId}.md`)
if (!slines.length) slines.push(`# scs-${adrId}: ${description}\n`)
if (!slines.length) {
slines.push(`# scs-${adrId}: ${ref.title}\n`)
if (ref.description !== undefined) {
slines.push(ref.description)
}
}
slines.push('| Version | Type | State | stabilized | obsoleted |')
slines.push('| -------- | ----- | ------- | ---------- | --------- |')
var link = `[${icon} scs-${adrId}](/standards/${track.toLowerCase()}/scs-${adrId})`
lines.push(`| ${link} | ${track} | ${description} | ${activeLinks.join(', ')} |`)
tlines.push(`| ${link} | ${description} | ${activeLinks.join(', ')} |`)
lines.push(`| ${link} | ${track} | ${ref.title} | ${activeLinks.join(', ')} |`)
tlines.push(`| ${link} | ${ref.title} | ${activeLinks.join(', ')} |`)
standardEntry[1].versions.forEach((obj) => {
var icon = obj.isActive ? '🟢' : '🟠'
var versionItem = {
Expand Down

0 comments on commit d384a34

Please sign in to comment.