diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2018-10-26 13:53:23 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2018-10-26 13:53:23 +0000 |
| commit | be7a27d275c75e77bd78233e4e393a4d9ad3957f (patch) | |
| tree | 89d25a244dcb566fe557bea02c2efa17d829b1db | |
| parent | add tablefs (diff) | |
| download | mmm-be7a27d275c75e77bd78233e4e393a4d9ad3957f.tar.gz mmm-be7a27d275c75e77bd78233e4e393a4d9ad3957f.zip | |
remove submodule
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | .gitmodules | 4 | ||||
| -rw-r--r-- | Tupfile | 3 | ||||
| -rw-r--r-- | app/index.moon | 44 | ||||
| -rw-r--r-- | app/init.moon | 96 | ||||
| m--------- | dist | 0 | ||||
| -rw-r--r-- | render.moon | 4 | ||||
| -rw-r--r-- | tup.moon | 3 |
8 files changed, 50 insertions, 105 deletions
@@ -3,3 +3,4 @@ ##### Do not edit. .tup /.gitignore +/dist diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 6f5737f..0000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "dist"] - path = dist - url = https://github.com/s-ol/mmm.git - branch = gh-pages @@ -11,9 +11,6 @@ CLIENT += app/tags/*.moon CLIENT += lib/*.client.moon CLIENT += lib/*.shared.moon -PAGES += app/* -PAGES += app/tags - # download fengari dependencies : |> !download |> dist/fengari-web.js : |> !download |> dist/fengari-web.js.map diff --git a/app/index.moon b/app/index.moon deleted file mode 100644 index 6c68dbe..0000000 --- a/app/index.moon +++ /dev/null @@ -1,44 +0,0 @@ -import h1, p, a, br, ul, tt, li from require 'lib.html' -import opairs from require 'lib.ordered' - -moon = '\xe2\x98\xbd' -demos = - 'twisted': 'canvas animation', - 'todo': 'Todo demo of a simple reactive UI framework', - 'realities': 'draft of a paper on virtual and other realities', - 'center_of_mass': 'aligning characters by their centers of mass', - 'test_component': 'Test suite for the UI framework', - 'tags': 'Playground for Functional Tags', - -on_client -> - redirs = - 'center-of-mass': 'center_of_mass', - 'test-component': 'test_component', - 'play-tags': 'tags', - - { :location } = window - if location.search and #location.search > 1 - name = location.search\sub 2 - location.href = redirs[name] or name - -append h1 'mmm' -append p { - tt 'mmm' - ' is not the ' - tt 'www' - ', because it runs on ' - a { 'MoonScript', href: 'https://moonscript.org' } - '.' - br! - 'You can find the source code of everything ' - a { 'here', href: 'https://github.com/s-ol/mmm' } - '.' -} -append p 'current demos:' -append ul for name, desc in opairs demos - li (a name, href: name), ': ', desc - -append p { - "made with #{moon} by " - a { 's-ol', href: 'https://twitter.com/S0lll0s' } -} diff --git a/app/init.moon b/app/init.moon index 1aaf969..daa2d47 100644 --- a/app/init.moon +++ b/app/init.moon @@ -1,66 +1,55 @@ require = relative ... -import opairs from require 'lib.ordered' -merge = (tables) -> - first = table.remove tables, 1 - for tbl in *tables - for k,v in pairs tbl - first[k] = v - first +patch_redirs = -> + redirs = + 'center-of-mass': 'center_of_mass', + 'test-component': 'test_component', + 'play-tags': 'tags', -experiments = - twisted: { - desc: 'canvas animation' - render: -> require '.twisted' + { :location } = window + if location.search and #location.search > 1 + name = location.search\sub 2 + location.href = redirs[name] or name + +experiments = { + { + name: 'twisted', + desc: 'pseudo 3d animation' }, - todo: { - desc: 'Todo demo of a simple reactive UI framework' - render: -> require '.todo' + { + name: 'koch', + desc: "lil' fractal thing", }, - realities: { - desc: 'draft of a paper on virtual and other realities' - render: -> require '.realities' + { + name: 'realities', + desc: 'a paper on virtual and other realities' }, - center_of_mass: { + { + name: 'center_of_mass', desc: 'aligning characters by their centers of mass' - render: -> require '.center_of_mass' }, - test_component: { - desc: 'Test suite for the UI framework' - render: -> require '.test_component' + { + name: 'todo', + desc: 'Todo MVC with the mmm UI framework' }, - tags: { - desc: 'Playground for Functional Tags' - render: -> require '.tags' + { + name: 'test_component', + desc: 'test suite for the mmm reactive UI framework' }, - tablefs: { - desc: 'A system bigger than filesystems' - render: -> require '.tablefs' + { + name: 'tags', + desc: 'organizing files with Functional Tags' }, - koch: { - desc: "lil' fractal thing", - render: -> require '.koch' + { + name: 'tablefs', + desc: 'a (file)system to live in' }, +} -destify = (name, route) -> - name, with route - .route = name - .dest = "#{name}/index.html" - -routes = { destify k,v for k,v in pairs experiments } - -patch_redirs = -> - redirs = - 'center-of-mass': 'center_of_mass', - 'test-component': 'test_component', - 'play-tags': 'tags', - - { :location } = window - if location.search and #location.search > 1 - name = location.search\sub 2 - location.href = redirs[name] or name +routes = [x for x in *experiments] -routes.index = { +table.insert routes, { + name: 'index' route: '' dest: 'index.html' render: => @@ -87,7 +76,7 @@ routes.index = { '.' } append p 'current demos:' - append ul for name, { :desc, :route } in opairs experiments + append ul for { :name, :desc, :route } in *experiments li (a name, href: route), ': ', desc append p { @@ -96,7 +85,14 @@ routes.index = { } } +destify = (route) -> with route + .route or= .name + .dest or= "#{.route}/index.html" + .render or= -> require '.' .. .name + +routes = [ destify route for route in *routes ] { :routes, + indexed: { r.name, r for r in *routes } render: (name) -> require ".#{name}" } diff --git a/dist b/dist deleted file mode 160000 -Subproject 27151d24984d95e190468c20d666ab569a9e02e diff --git a/render.moon b/render.moon index 8dca141..218e934 100644 --- a/render.moon +++ b/render.moon @@ -1,10 +1,10 @@ package.moonpath = './?.shared.moon;./?.server.moon;' .. package.moonpath import flush from require 'lib.init' -import routes from require 'app' +import indexed from require 'app' route_name = assert arg[1], "please specify the route name to build as an argument" -route = assert routes[route_name], "route not found: '#{route_name}'" +route = assert indexed[route_name], "route not found: '#{route_name}'" route\render! print "<!DOCTYPE html> @@ -1,7 +1,6 @@ package.moonpath = './?.shared.moon;./?.server.moon;' .. package.moonpath require 'lib.init' import routes from require 'app' -import opairs from require 'lib.ordered' -for name, { :dest } in opairs routes +for { :name, :dest } in *routes print ": |> ^ HTML #{name}^ moon render.moon #{name} > %o |> dist/#{dest}" |
