Skip to content

Commit

Permalink
Version 74
Browse files Browse the repository at this point in the history
  • Loading branch information
Breck Yunits authored and Breck Yunits committed Apr 6, 2024
1 parent 5c5e828 commit 2a12a25
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
6 changes: 2 additions & 4 deletions grammar/groups.grammar
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions grammar/root.grammar
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scroll-cli",
"version": "73.2.0",
"version": "74.0.0",
"description": "Tools for thoughts.",
"main": "scroll.js",
"engines": {
Expand Down
4 changes: 4 additions & 0 deletions releaseNotes.scroll
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 10 additions & 1 deletion scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 2a12a25

Please sign in to comment.