aboutsummaryrefslogtreecommitdiffstats
path: root/root
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2018-11-08 06:17:17 +0000
committers-ol <s-ol@users.noreply.github.com>2018-11-08 06:17:17 +0000
commitd11441884740d394f73f1a145b502e270482a2d2 (patch)
tree8ce1258d8f66a65945b611b6a2836eadd5861889 /root
parentadd $order mechanism (diff)
downloadmmm-d11441884740d394f73f1a145b502e270482a2d2.tar.gz
mmm-d11441884740d394f73f1a145b502e270482a2d2.zip
recursive tup stuff
Diffstat (limited to 'root')
-rw-r--r--root/Tupdefault.lua23
-rw-r--r--root/articles/mmmfs/gallery.moon49
-rw-r--r--root/articles/mmmfs/gallery/image_1/URL -> image$png1
-rw-r--r--root/articles/mmmfs/gallery/image_1/preview: URL -> image$png1
-rw-r--r--root/articles/mmmfs/gallery/preview: text$moonscript -> fn -> mmm$dom.moon16
-rw-r--r--root/articles/mmmfs/gallery/slideshow: text$moonscript -> fn -> mmm$component.moon19
-rw-r--r--root/articles/mmmfs/gallery/text$moonscript -> fn -> mmm$dom.moon12
-rw-r--r--root/articles/mmmfs/gallery/title: text$plain1
8 files changed, 73 insertions, 49 deletions
diff --git a/root/Tupdefault.lua b/root/Tupdefault.lua
new file mode 100644
index 0000000..b6cf700
--- /dev/null
+++ b/root/Tupdefault.lua
@@ -0,0 +1,23 @@
+facets = tup.glob '*'
+inputs = ''
+for i, file in ipairs(facets) do
+ inputs = inputs .. " '" .. file .. "'"
+end
+
+LUA_PATH = {}
+LUA_PATH += root .. '/?.lua'
+LUA_PATH += root .. '/?.server.lua'
+LUA_PATH += root .. '/?/init.lua'
+LUA_PATH += root .. '/?/init.server.lua'
+LUA_PATH = 'LUA_PATH="' .. table.concat(LUA_PATH, ';') .. '"'
+
+exec = LUA_PATH .. ' moon ' .. root .. '/bundle_fileder.moon'
+
+facets += '<children>'
+facets += root .. '/<modules>'
+
+tup.rule(
+ facets,
+ '^ BNDL %d^ ' .. exec .. ' %d ' .. inputs .. ' -- %<children>',
+ { '$bundle.lua', '../<children>' }
+)
diff --git a/root/articles/mmmfs/gallery.moon b/root/articles/mmmfs/gallery.moon
deleted file mode 100644
index 4713101..0000000
--- a/root/articles/mmmfs/gallery.moon
+++ /dev/null
@@ -1,49 +0,0 @@
-import define_fileders from require 'mmm.mmmfs'
-import div, h1, a, img, br from require 'mmm.dom'
-
-Fileder = define_fileders ...
-
-with Fileder {
- 'name: alpha': 'gallery',
- 'title: text/plain': "A Gallery of 25 random pictures, come in!",
- 'preview: fn -> mmm/dom': => div {
- 'the first pic as a little taste:',
- br!,
- img src: @children[1]\get 'preview', 'URL -> image/png'
- }
- 'fn -> mmm/dom': =>
- link = (child) -> a {
- href: '#',
- onclick: -> BROWSER\navigate child.path
- img src: child\gett 'preview', 'URL -> image/png'
- }
-
- content = [link child for child in *@children]
- table.insert content, 1, h1 'gallery index'
- div content
-
- 'slideshow: fn -> mmm/dom': =>
- import ReactiveVar, text, elements from require 'mmm.component'
-
- index = ReactiveVar 1
-
- prev = (i) -> math.max 1, i - 1
- next = (i) -> math.min #@children, i + 1
-
- e = elements
- e.div {
- e.div {
- e.a 'prev', href: '#', onclick: -> index\transform prev
- index\map (i) -> text " image ##{i} "
- e.a 'next', href: '#', onclick: -> index\transform next
- },
- index\map (i) -> img src: @children[i]\gett nil, 'URL -> image/png'
- }
- }
- for i=1,25
- id = 120 + i
- .children[i] = Fileder {
- 'name: alpha': "image#{id}"
- 'URL -> image/png': "https://picsum.photos/600/600/?image=#{id}"
- 'preview: URL -> image/png': "https://picsum.photos/200/200/?image=#{id}"
- }
diff --git a/root/articles/mmmfs/gallery/image_1/URL -> image$png b/root/articles/mmmfs/gallery/image_1/URL -> image$png
new file mode 100644
index 0000000..7cf76ff
--- /dev/null
+++ b/root/articles/mmmfs/gallery/image_1/URL -> image$png
@@ -0,0 +1 @@
+https://picsum.photos/600/600/?image=101
diff --git a/root/articles/mmmfs/gallery/image_1/preview: URL -> image$png b/root/articles/mmmfs/gallery/image_1/preview: URL -> image$png
new file mode 100644
index 0000000..2b2233b
--- /dev/null
+++ b/root/articles/mmmfs/gallery/image_1/preview: URL -> image$png
@@ -0,0 +1 @@
+https://picsum.photos/200/200/?image=101
diff --git a/root/articles/mmmfs/gallery/preview: text$moonscript -> fn -> mmm$dom.moon b/root/articles/mmmfs/gallery/preview: text$moonscript -> fn -> mmm$dom.moon
new file mode 100644
index 0000000..83aa7d4
--- /dev/null
+++ b/root/articles/mmmfs/gallery/preview: text$moonscript -> fn -> mmm$dom.moon
@@ -0,0 +1,16 @@
+import div, img, br from require 'mmm.dom'
+
+=> div {
+ 'the first pic as a little taste:',
+ br!,
+ img src: @children[1]\get 'preview', 'URL -> image/png'
+}
+ }
+
+-- for i=1,25
+-- id = 120 + i
+-- .children[i] = Fileder {
+-- 'name: alpha': "image#{id}"
+-- 'URL -> image/png': "https://picsum.photos/600/600/?image=#{id}"
+-- 'preview: URL -> image/png': "https://picsum.photos/200/200/?image=#{id}"
+-- }
diff --git a/root/articles/mmmfs/gallery/slideshow: text$moonscript -> fn -> mmm$component.moon b/root/articles/mmmfs/gallery/slideshow: text$moonscript -> fn -> mmm$component.moon
new file mode 100644
index 0000000..0178ac2
--- /dev/null
+++ b/root/articles/mmmfs/gallery/slideshow: text$moonscript -> fn -> mmm$component.moon
@@ -0,0 +1,19 @@
+import ReactiveVar, text, elements from require 'mmm.component'
+import div, a, img from elements
+
+=>
+ index = ReactiveVar 1
+
+ prev = (i) -> math.max 1, i - 1
+ next = (i) -> math.min #@children, i + 1
+
+ div {
+ div {
+ a 'prev', href: '#', onclick: -> index\transform prev
+ index\map (i) -> text " image ##{i} "
+ a 'next', href: '#', onclick: -> index\transform next
+ },
+ index\map (i) ->
+ child = assert @children[i], "image not found!"
+ img src: @children[i]\gett 'URL -> image/png'
+ }
diff --git a/root/articles/mmmfs/gallery/text$moonscript -> fn -> mmm$dom.moon b/root/articles/mmmfs/gallery/text$moonscript -> fn -> mmm$dom.moon
new file mode 100644
index 0000000..9bdac54
--- /dev/null
+++ b/root/articles/mmmfs/gallery/text$moonscript -> fn -> mmm$dom.moon
@@ -0,0 +1,12 @@
+import div, h1, a, img, br from require 'mmm.dom'
+
+=>
+ link = (child) -> a {
+ href: '#',
+ onclick: -> BROWSER\navigate child.path
+ img src: child\gett 'preview', 'URL -> image/png'
+ }
+
+ content = [link child for child in *@children]
+ table.insert content, 1, h1 'gallery index'
+ div content
diff --git a/root/articles/mmmfs/gallery/title: text$plain b/root/articles/mmmfs/gallery/title: text$plain
new file mode 100644
index 0000000..ad74eec
--- /dev/null
+++ b/root/articles/mmmfs/gallery/title: text$plain
@@ -0,0 +1 @@
+A Gallery of 25 random pictures, come on in!