1
0
mirror of synced 2025-12-23 21:07:12 -05:00

Merge branch 'main' into few-more-archival-script-tweaks

This commit is contained in:
Sarah Schneider
2020-11-18 11:12:07 -05:00
committed by GitHub
661 changed files with 12497 additions and 7803 deletions

View File

@@ -16,7 +16,7 @@ const files = ['content', 'data'].map(dir => {
}).flat()
// match [foo](/v3) and [bar](/v4) Markdown links
const linkRegex = new RegExp('\\(/v[34].*?\\)', 'g')
const linkRegex = /\(\/v[34].*?\)/g
main()

View File

@@ -76,11 +76,11 @@ async function main () {
function getEntry (matches, regex) {
return matches
? matches.map(match => {
const entry = {}
entry.title = cleanPreviewLinks(match.match(regex)[1])
entry.changes = getChangedItems(match.match(regex)[2])
return entry
})
const entry = {}
entry.title = cleanPreviewLinks(match.match(regex)[1])
entry.changes = getChangedItems(match.match(regex)[2])
return entry
})
: []
}

View File

@@ -46,6 +46,7 @@ allScripts.forEach(script => {
if (startCommentRegex.test(cmt)) addToReadme = true
if (endCommentRegex.test(cmt)) addToReadme = false
if (addToReadme && !cmt.includes(startComment) && !cmt.includes(endComment)) return cmt
return false
})
// remove comment markers and clean up newlines
.map(cmt => cmt.replace(/^(\/\/|#) ?/m, ''))