From 2a12a258025d6aade7568c563e2bc74e9ffc8fe8 Mon Sep 17 00:00:00 2001 From: Breck Yunits Date: Sat, 6 Apr 2024 10:46:33 -0400 Subject: [PATCH] Version 74 --- grammar/groups.grammar | 6 ++---- grammar/root.grammar | 3 +++ package.json | 2 +- releaseNotes.scroll | 4 ++++ scroll.js | 11 ++++++++++- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/grammar/groups.grammar b/grammar/groups.grammar index 4587668f0..10ca4394d 100644 --- a/grammar/groups.grammar +++ b/grammar/groups.grammar @@ -5,9 +5,7 @@ groupNameWithOptionalFolderCell extends stringCell groupsParser description Add this file to zero or more groups. - cruxFromId example - groups index.html - extends abstractTopLevelSingleMetaParser - cells keywordCell + groups index + extends abstractTopLevelMultipleMetaParser catchAllCellType groupNameCell \ No newline at end of file diff --git a/grammar/root.grammar b/grammar/root.grammar index f3ab021b8..340e0e163 100644 --- a/grammar/root.grammar +++ b/grammar/root.grammar @@ -26,6 +26,9 @@ abstractTopLevelSingleMetaParser compile() { return "" } +abstractTopLevelMultipleMetaParser + description Use these keywords once or more per file. Values will be treated as if they were concatenated by a space. + extends abstractTopLevelSingleMetaParser scrollParser extensions scroll description Tools for thought thats compile to HTML. diff --git a/package.json b/package.json index b75ecc8c5..6a0b7432b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scroll-cli", - "version": "73.2.0", + "version": "74.0.0", "description": "Tools for thoughts.", "main": "scroll.js", "engines": { diff --git a/releaseNotes.scroll b/releaseNotes.scroll index c028554a4..4d0e202d4 100644 --- a/releaseNotes.scroll +++ b/releaseNotes.scroll @@ -4,6 +4,10 @@ title Scroll Release Notes startColumns +# 74.0.0 4/06/2024 +- 🎉 you can now use the keyword `groups` multiple times. +- ⚠️ BREAKING: if for some reason you were using multiple `groups` keywords expecting the latter to override the former (I don't think this should ever have happened), this will break that behavior. + # 73.2.0 4/05/2024 - 🎉 added `thanksTo` keyword diff --git a/scroll.js b/scroll.js index bf5c254e2..3f83de2a8 100755 --- a/scroll.js +++ b/scroll.js @@ -267,8 +267,17 @@ class ScrollFile { return viewSourceBaseUrl ? viewSourceBaseUrl.replace(/\/$/, "") + "/" + filename : filename } + _groups = undefined get groups() { - return this.scrollProgram.get(scrollKeywords.groups) || "" + if (this._groups !== undefined) return this._groups + // merge all groups + // todo: TN really needs a better hash table for key:values[] type. such a horrible mess of footguns. + const groups = this.scrollProgram + .findNodes(scrollKeywords.groups) + .map(node => node.content) + .join(" ") + this._groups = groups || "" + return this._groups } get primaryGroup() {