------------------------------------------------------------
commit 8655386ea1c467fece65958b6fe26d7f50b5f265
Author: ffff:99.11.193.233 <ffff:99.11.193.233@hub.scroll.pub>
Date: Sun Dec 22 00:54:49 2024 +0000
updated index.scroll
diff --git a/index.scroll b/index.scroll
index 8c0cfee..73c2fa1 100644
--- a/index.scroll
+++ b/index.scroll
@@ -22,10 +22,10 @@ belowAsCode
playgroundIde
file index.html
<!doctype html>
- <body>
+ <body>
Hello
<script type="module" src="./index.js"></script>
- </body>
+ </body>
file index.js
document.body.appendChild(document.createTextNode("World!"))
------------------------------------------------------------
commit 216c6b05d35ad2351da0a47d6fa7d13b9331396a
Author: ffff:99.11.193.233 <ffff:99.11.193.233@hub.scroll.pub>
Date: Sun Dec 22 00:52:12 2024 +0000
updated index.scroll
diff --git a/index.scroll b/index.scroll
index ec695a1..8c0cfee 100644
--- a/index.scroll
+++ b/index.scroll
@@ -17,25 +17,20 @@ Serverless coding environments for the web.
link https://github.com/google/playground-elements
## with the IDE
+playground-ide.scroll
belowAsCode
-script
- import('https://cdn.jsdelivr.net/npm/playground-elements@0.18.1/+esm')
-
-belowAsCode
-<playground-ide style="height: 150px;" editable-file-system line-numbers resizable>
- <script type="sample/html" filename="index.html">
- <!doctype html>
- <body>
- Hello
- <script type="module" src="./index.js"></script>
- </body>
- </script>
- <script type="sample/js" filename="index.js">
- document.body.appendChild(document.createTextNode("World!"))
- </script>
- </playground-ide>
+playgroundIde
+ file index.html
+ <!doctype html>
+ <body>
+ Hello
+ <script type="module" src="./index.js"></script>
+ </body>
+ file index.js
+ document.body.appendChild(document.createTextNode("World!"))
## without the IDE
+TODO: make scroll parser for this also
belowAsCode
<playground-project id=hello1 style="display:none">
<script type="sample/html" filename="index.html">
------------------------------------------------------------
commit 8467d7c2f13ec9bd2f438e6d66fe4d1f2e77b4b6
Author: ffff:99.11.193.233 <ffff:99.11.193.233@hub.scroll.pub>
Date: Sun Dec 22 00:48:32 2024 +0000
updated playground-ide.scroll
diff --git a/playground-ide.scroll b/playground-ide.scroll
index e69de29..0ac68ce 100644
--- a/playground-ide.scroll
+++ b/playground-ide.scroll
@@ -0,0 +1,33 @@
+script
+ import('https://cdn.jsdelivr.net/npm/playground-elements@0.18.1/+esm')
+
+fileNameAtom
+ paint constant.language
+playgroundFileParser
+ cue file
+ description file name and contents
+ atoms cueAtom fileNameAtom
+ catchAllParser lineOfCodeParser
+ javascript
+ buildHtml() {
+ const extension = this.content.split(".").pop()
+ return `
+ <script type="sample/${extension}" filename="${this.content}">
+ ${this.subparticlesToString()}
+ </script>
+ `;
+ }
+
+playgroundIdeParser
+ extends abstractScrollParser
+ inScope playgroundFileParser
+ description playground-ide for html/typescript/javascript
+ cueFromId
+ javascript
+ buildHtml() {
+ return `
+ <playground-ide style="height: 150px;" editable-file-system line-numbers resizable>
+ ${this.filter(p => p.buildHtml).map(p => p.buildHtml()).join("\n")}
+ </playground-ide>
+ `;
+ }
------------------------------------------------------------
commit 78893ac554a0be57388c226fc66401392e4917b8
Author: ffff:99.11.193.233 <ffff:99.11.193.233@hub.scroll.pub>
Date: Sun Dec 22 00:46:05 2024 +0000
created playground-ide.scroll
diff --git a/playground-ide.scroll b/playground-ide.scroll
new file mode 100644
index 0000000..e69de29
------------------------------------------------------------
commit 629255c226801988a80e98233adf8d9e62c5be8a
Author: ffff:99.11.193.233 <ffff:99.11.193.233@hub.scroll.pub>
Date: Wed Dec 18 03:44:00 2024 +0000
updated index.scroll
diff --git a/index.scroll b/index.scroll
index 73ec1d1..ec695a1 100644
--- a/index.scroll
+++ b/index.scroll
@@ -1,5 +1,13 @@
buildHtml
theme gazette
+
+title Code playgrounds
+printTitle
+
+authors btheado
+ link https://github.com/btheado btheado
+printAuthors
+
authors https://github.com/btheado
thinColumns
------------------------------------------------------------
commit 0cfcedbf90f05cf95a24e15553e5ad721662a5c2
Author: ffff:99.11.193.233 <ffff:99.11.193.233@hub.scroll.pub>
Date: Wed Dec 18 03:37:57 2024 +0000
updated index.scroll
diff --git a/index.scroll b/index.scroll
index 221a506..73ec1d1 100644
--- a/index.scroll
+++ b/index.scroll
@@ -119,7 +119,7 @@ tryscroll
code
two = 1 + 1
-why does the above only show the editor and not the preview? When I had iframe directly both showed
+why does the above only show the editor and not the preview? When I had iframe directly both showed. Ok both don't show, but it fills the column width
belowAsCode
<iframe style="width: 100%; height: 300px;" src="https://try.scroll.pub/#scroll%0A%20theme%20gazette%0A%20code%0A%20%20two%20%3D%201%20%2B%201"></iframe>
------------------------------------------------------------
commit 23452884165ba531cd11b68c47b6f49af4a8dab3
Author: ffff:99.11.193.233 <ffff:99.11.193.233@hub.scroll.pub>
Date: Wed Dec 18 03:36:46 2024 +0000
updated index.scroll
diff --git a/index.scroll b/index.scroll
index 86dd896..221a506 100644
--- a/index.scroll
+++ b/index.scroll
@@ -119,6 +119,11 @@ tryscroll
code
two = 1 + 1
+why does the above only show the editor and not the preview? When I had iframe directly both showed
+
+belowAsCode
+<iframe style="width: 100%; height: 300px;" src="https://try.scroll.pub/#scroll%0A%20theme%20gazette%0A%20code%0A%20%20two%20%3D%201%20%2B%201"></iframe>
+
belowAsCode
Link to open a scroll program on try scroll
link https://try.scroll.pub/# try scroll
------------------------------------------------------------
commit dbd35224187c3fbd618896c41e6a8e339d8a9cc4
Author: ffff:99.11.193.233 <ffff:99.11.193.233@hub.scroll.pub>
Date: Wed Dec 18 03:34:13 2024 +0000
updated index.scroll
diff --git a/index.scroll b/index.scroll
index 1d6d7b4..86dd896 100644
--- a/index.scroll
+++ b/index.scroll
@@ -43,6 +43,8 @@ belowAsCode
</playground-project>
<playground-preview style="height: 150px;" project="hello1"></playground-preview>
+***
+
# code-api
https://codapi.org/ and https://github.com/nalgeon/codapi-js
@@ -100,6 +102,8 @@ belowAsCode
</pre>
<codapi-snippet engine="wasi" sandbox="lua" editor="basic"></codapi-snippet>
+***
+
# scroll!
tryscroll.scroll
------------------------------------------------------------
commit b6d1f6dcfeb4e099451dacb1388c58062cdb1ec7
Author: ffff:99.11.193.233 <ffff:99.11.193.233@hub.scroll.pub>
Date: Wed Dec 18 03:33:20 2024 +0000
updated tryscroll.scroll
diff --git a/tryscroll.scroll b/tryscroll.scroll
index 38ecbe1..e46f1f4 100644
--- a/tryscroll.scroll
+++ b/tryscroll.scroll
@@ -1,6 +1,3 @@
-programLinkParser
- catchAllAtomType codeAtom
-
tryscrollParser
extends scrollParagraphParser
description Try scroll program in iframe
@@ -25,7 +22,6 @@ tryscrollParser
get link() {
const baseLink = "https://try.scroll.pub/#"
if (this.has("program")) {
- console.log(baseLink + this.getParticle("program").encoded);
return baseLink + this.getParticle("program").encoded
}
return baseLink
------------------------------------------------------------
commit ac276f8a6d32f7e40efabc69390c9c2f081293a3
Author: ffff:99.11.193.233 <ffff:99.11.193.233@hub.scroll.pub>
Date: Wed Dec 18 03:32:00 2024 +0000
updated tryscroll.scroll
diff --git a/tryscroll.scroll b/tryscroll.scroll
index ffe1132..38ecbe1 100644
--- a/tryscroll.scroll
+++ b/tryscroll.scroll
@@ -1,3 +1,6 @@
+programLinkParser
+ catchAllAtomType codeAtom
+
tryscrollParser
extends scrollParagraphParser
description Try scroll program in iframe