diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2018-11-26 08:32:31 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2018-11-26 08:32:31 +0000 |
| commit | eb1f079b01a4969090796d113d692bb9caa061da (patch) | |
| tree | 54f6d73aa1a517e1d78c6284118ecc5e00c28864 | |
| parent | update readme (diff) | |
| download | mmm-eb1f079b01a4969090796d113d692bb9caa061da.tar.gz mmm-eb1f079b01a4969090796d113d692bb9caa061da.zip | |
metadata
| -rw-r--r-- | build/render_fileder.moon | 75 | ||||
| -rw-r--r-- | root/articles/mmmfs/text$moonscript -> fn -> mmm$dom.moon | 4 | ||||
| -rw-r--r-- | root/blog/love_lua_photoshop_and_games/mmm$tpl -> text$markdown.md | 8 | ||||
| -rw-r--r-- | root/description: text$plain | 1 | ||||
| -rw-r--r-- | root/title: text$plain | 1 | ||||
| -rw-r--r-- | scss/_content.scss | 4 |
6 files changed, 64 insertions, 29 deletions
diff --git a/build/render_fileder.moon b/build/render_fileder.moon index 5a1a817..280be25 100644 --- a/build/render_fileder.moon +++ b/build/render_fileder.moon @@ -34,6 +34,36 @@ do seed path +get_meta = => + title = (@get 'title: text/plain') or @gett 'name: alpha' + + l = (str) -> + str = str\gsub '[%s\\n]+$', '' + str\gsub '\\n', ' ' + e = (str) -> string.format '%q', l str + + meta = " + <meta charset=\"UTF-8\"> + <title>#{l title}</title> + " + + if page_meta = @get '_meta: mmm/dom' + meta ..= page_meta + else + _path = path + _path = '/' if _path == '' + meta ..= " + <meta property=\"og:title\" content=#{e title} /> + <meta property=\"og:type\" content=\"website\" /> + <meta property=\"og:url\" content=\"https://mmm.s-ol.nu#{_path}\" /> + <meta property=\"og:site_name\" content=\"mmm\" />" + + if desc = @get 'description: text/plain' + meta ..= " + <meta property=\"og:description\" content=#{e desc} />" + + meta + root = dofile '$bundle.lua' assert root, "couldn't load $bundle.lua" root\mount path, true @@ -41,21 +71,23 @@ root\mount path, true BROWSER = Browser root, path with io.open 'index.html', 'w' - \write "<!DOCTYPE html> + \write [[ +<!DOCTYPE html> <html> <head> - <meta charset=\"UTF-8\"> - <title>MMM: lunar low-gravity scripting playground</title> - <link rel=\"stylesheet\" type=\"text/css\" href=\"/main.css\" /> + <link rel="stylesheet" type="text/css" href="/main.css" /> <!-- - <link rel=\"preload\" as=\"fetch\" href=\"/mmm/dom/init.lua\" /> - <link rel=\"preload\" as=\"fetch\" href=\"/mmm/component/init.lua\" /> - <link rel=\"preload\" as=\"fetch\" href=\"/mmm/mmmfs/init.lua\" /> - <link rel=\"preload\" as=\"fetch\" href=\"/mmm/mmmfs/fileder.lua\" /> - <link rel=\"preload\" as=\"fetch\" href=\"/mmm/mmmfs/browser.lua\" /> + <link rel="preload" as="fetch" href="/mmm/dom/init.lua" /> + <link rel="preload" as="fetch" href="/mmm/component/init.lua" /> + <link rel="preload" as="fetch" href="/mmm/mmmfs/init.lua" /> + <link rel="preload" as="fetch" href="/mmm/mmmfs/fileder.lua" /> + <link rel="preload" as="fetch" href="/mmm/mmmfs/browser.lua" /> --> - <link href=\"https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,400\" rel=\"stylesheet\"> + <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,400" rel="stylesheet"> + ]] + \write " + #{get_meta root} </head> <body> #{header} @@ -63,15 +95,17 @@ with io.open 'index.html', 'w' #{assert (tohtml BROWSER), "couldn't render BROWSER"} #{footer} - - <script src=\"/highlight.pack.js\"></script> - <script src=\"//cdnjs.cloudflare.com/ajax/libs/marked/0.5.1/marked.min.js\"></script> - <script src=\"//cdnjs.cloudflare.com/ajax/libs/svg.js/2.6.6/svg.min.js\"></script> - <script src=\"//platform.twitter.com/widgets.js\" charset=\"utf-8\"></script> - <script src=\"/fengari-web.js\"></script> - <script type=\"application/lua\" src=\"/mmm.bundle.lua\"></script> - <script type=\"application/lua\">require 'mmm'</script> - + " + \write [[ + <script src="/highlight.pack.js"></script> + <script src="//cdnjs.cloudflare.com/ajax/libs/marked/0.5.1/marked.min.js"></script> + <script src="//cdnjs.cloudflare.com/ajax/libs/svg.js/2.6.6/svg.min.js"></script> + <script src="//platform.twitter.com/widgets.js" charset="utf-8"></script> + <script src="/fengari-web.js"></script> + <script type="application/lua" src="/mmm.bundle.lua"></script> + <script type="application/lua">require 'mmm'</script> + ]] + \write " <script type=\"application/lua\"> on_load = on_load or {} table.insert(on_load, function() @@ -84,5 +118,6 @@ with io.open 'index.html', 'w' end) </script> </body> -</html>" +</html> + " \close! diff --git a/root/articles/mmmfs/text$moonscript -> fn -> mmm$dom.moon b/root/articles/mmmfs/text$moonscript -> fn -> mmm$dom.moon index de28192..7bb192d 100644 --- a/root/articles/mmmfs/text$moonscript -> fn -> mmm$dom.moon +++ b/root/articles/mmmfs/text$moonscript -> fn -> mmm$dom.moon @@ -43,8 +43,8 @@ and working at the computer. mmmfs is made for more than just storing information. Files in mmmfs can interact and morph to create complex behaviours." - append p "Let us take as an example the simple task of collecting and arranging a mixed collection of images and texts - in order to brainstorm. To create an assemblage of pictures and text, many might be tempted to open an + append p "Let us take as an example the simple task of collecting and arranging a mixed collection of images, videos + and texts in order to brainstorm. To create an assemblage of pictures and text, many might be tempted to open an Application like Microsoft Word or Adobe Photoshop and create a new document there. Both photoshop files and word documents are capable of containing texts and images, but when the files are saved, direct access to the contained data is lost. It is for example a non-trivial and unenjoyable task to edit an image file contained diff --git a/root/blog/love_lua_photoshop_and_games/mmm$tpl -> text$markdown.md b/root/blog/love_lua_photoshop_and_games/mmm$tpl -> text$markdown.md index 7506135..85d6ce9 100644 --- a/root/blog/love_lua_photoshop_and_games/mmm$tpl -> text$markdown.md +++ b/root/blog/love_lua_photoshop_and_games/mmm$tpl -> text$markdown.md @@ -24,9 +24,7 @@ Specifically, I started writing something that loads a .PSD directly and animate I also added code that detects file changes and reloads them automatically. At the end of the second project day, I had this: -<video controls> - <source src="{{sheet+URL -> video/mp4}}" type="video/mp4" /> -</video> +<mmm-embed path="sheet" nolink></mmm-embed> The code for this isn't much, but it took a few iterations to make the file- reload-watching reuseable and work on Linux and Windows alike (and efficient). I used a 3rd party library for loading the photoshop files, but I had to patch it a lot. @@ -116,7 +114,7 @@ Because this could also be done by a mixin, i am thinking about abolishing the _ You can see the system working in this clip: -<mmm-embed path="animating"></mmm-embed> +<mmm-embed path="animating" nolink></mmm-embed> _making an animation out of the single rain layer_ Moreover, I added a directory structure for mixins; to load a mixin called _name _for a scene called _scene_, it first looks in the scene specific directories: @@ -225,7 +223,7 @@ Here's the code for both: By the end of the three day "test phase". This is how the first scene looked in-game: -<mmm-embed path="final"></mmm-embed> +<mmm-embed path="final" nolink></mmm-embed> Here's _psdscene.moon_, wrapping most things mentioned in this article: diff --git a/root/description: text$plain b/root/description: text$plain new file mode 100644 index 0000000..90d0358 --- /dev/null +++ b/root/description: text$plain @@ -0,0 +1 @@ +mmm is not the www, because it runs on MoonScript. diff --git a/root/title: text$plain b/root/title: text$plain new file mode 100644 index 0000000..b56e7bb --- /dev/null +++ b/root/title: text$plain @@ -0,0 +1 @@ +MMM: lunar low-gravity scripting playground diff --git a/scss/_content.scss b/scss/_content.scss index b3468bd..0272508 100644 --- a/scss/_content.scss +++ b/scss/_content.scss @@ -1,8 +1,8 @@ .content { - img, video, pre > code { + img, video { display: block; max-width: 100%; - max-height: 100%; + max-height: 50vh; padding: 0 2em; box-sizing: border-box; |
