Skip to content

Instantly share code, notes, and snippets.

@5HT
Created October 23, 2013 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save 5HT/7117914 to your computer and use it in GitHub Desktop.
Save 5HT/7117914 to your computer and use it in GitHub Desktop.
defmodule N2O do
defmacro element_base(mod) do quote do [ancestor: :element, module: unquote(mod), id: :undefined,
actions: [], class: [], style: [], source: [],
data_fields: [], aria_states: [], body: [], role: [],
tabindex: 0, show_if: false, html_tag: :undefined, title: []] end end
defrecord :dtl, N2O.element_base(:element_dtl) ++ [file: "index", bindings: [], app: __DIR__, folder: "priv/templates", ext: "html", bind_script: true]
defrecord :context, Record.extract(:context, from_lib: "n2o/include/wf.hrl")
defrecord :button, Record.extract(:button, from_lib: "n2o/include/wf.hrl")
defrecord :http_req, Record.extract(:http_req, from_lib: "cowboy/src/cowboy_req.erl")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment