Skip to content

Commit

Permalink
add quickjson
Browse files Browse the repository at this point in the history
  • Loading branch information
breck7 committed Sep 25, 2024
1 parent 3868f09 commit ac972dd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
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": "133.3.0",
"version": "133.4.0",
"description": "A language for scientists of all ages. A curated collection of tools for refining and sharing thoughts.",
"main": "scroll.js",
"engines": {
Expand Down
11 changes: 11 additions & 0 deletions parsers/json.parsers
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
quickIncludeJsonParser
popularity 0.007524
description Include JSON and assign to window.
extends abstractQuickIncludeParser
atoms urlAtom
pattern ^[^\s]+\.json$
javascript
compile() {
const varName = this.filename.split("/").pop().replace(".json", "")
return `<script>window.${varName} = ${this.root.readFile(this.filename)}</script>`
}
3 changes: 3 additions & 0 deletions releaseNotes.scroll
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ ciBadges.scroll
br
thinColumns

📦 133.4.0 9/24/2024
🎉 added `quickIncludeJsonParser` parser

📦 133.3.0 9/24/2024
🎉 added `cloc` parser
🎉 you can now use quickHtml in table flows
Expand Down
5 changes: 5 additions & 0 deletions tests/json.scroll
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
buildHtml
../package.json
window.package.description says:
script
document.write(window.package.description)

0 comments on commit ac972dd

Please sign in to comment.