aboutsummaryrefslogtreecommitdiffstats
path: root/root/meta/text$moonscript -> fn -> mmm$dom.moon
blob: 5430212ce3f90411fcff72d06a35720fc019bcac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import div, h3, p, br, ul, li, i from require 'mmm.dom'
import link_to from (require 'mmm.mmmfs.util') require 'mmm.dom'

=> div {
    style: { 'max-width': '700px' }
    h3 link_to @
    p "mmm.dom and mmm.component are Lua/Moonscript modules for web development.
      Both modules are 'polymorphic' - they can run in the ", (i 'browser'),
      ", using the native browser API for creating and interacting with DOM content, as well as on the ",
      (i 'server'), ", where they operate on and produce equivalent HTML strings."
    p "As the two implementations of each module are designed to be compatible,
      mmm facilitates code and content sharing between server and client
      and enables serverside rendering and rehydration."
    ul for child in *@children
      desc = child\gett 'description: mmm/dom'
      li (link_to child), ': ', desc
  }