index.html 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <html>
  2. <head>
  3. <meta charset="utf-8" />
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <meta name="description" content="" />
  7. <meta name="author" content="Maxim Sokhatsky" />
  8. <title>MAD</title>
  9. <link rel="stylesheet" href="https://synrc.space/synrc.css" />
  10. </head>
  11. <body>
  12. <nav>
  13. <a href='https://synrc.space/'>SYNRC</a>
  14. <a href='https://n2o.space'>N2O ECO</a>
  15. </nav>
  16. <header>
  17. <a href="https://n2o.space"><img src="https://synrc.space/images/Synrc Neo.svg?v=1"></a>
  18. <h1>MAD</h1>
  19. </header>
  20. <aside>
  21. <article>
  22. <section>
  23. <h3>SYNOPSIS</h3>
  24. <div>MAD is a small and fast rebar replacement.
  25. </div>
  26. </section>
  27. <section>
  28. <a name=plugin><h3>INSTALL</h3></a>
  29. <div>Place MAD binary into <b>$PATH</b> or <b>/usr/local/bin</b>. E.g. using curl:
  30. <figure>
  31. <code>
  32. $ curl -fsSL \
  33. https://git.io/fpYm4 \
  34. > mad && chmod +x mad \
  35. && sudo cp mad /usr/local/bin
  36. </code>
  37. </figure>
  38. <div>
  39. Nov 2018 &copy; <a href="https://github.com/synrc/mad">Namdak Tonpa</a> ISC
  40. </div>
  41. </section>
  42. </article>
  43. </aside>
  44. <main>
  45. <section>
  46. <a name=mqtt><h3>HELP</h3></a>
  47. <p> MAD accepts a list of words. This list of words contains special words,
  48. delimiters or commands.
  49. Words between commands are arguments for the nearest command from left.
  50. </p>
  51. <figure><code>
  52. $ mad
  53. MAD Manage Dependencies ad426a
  54. invoke = mad | mad list
  55. list = [] | command [options] list
  56. command = app [web|mqtt] &lt;name&gt; | deps | clean | compile | strip
  57. | bundle [beam|script] &lt;name&gt; | get &lt;repo&gt; | up [name]
  58. | start | stop | attach | repl | static &lt;min&gt;
  59. </code></figure>
  60. <div>
  61. <ul>
  62. <li><b><a href="man/mad.htm">mad</a></b> &mdash; MAD Main Module</li>
  63. <li><b><a href="man/mad_local.htm">mad_local</a></b> &mdash; MAD POSIX Profile</li>
  64. </ul>
  65. </div>
  66. </section>
  67. <section>
  68. <a name=docs><h3>APP</h3></a>
  69. <p>Create predefined sample application.
  70. MAD has built-in two sample applications: <b>web</b> and <b>mqtt</b>. </p>
  71. <figure><code>
  72. $ mad app web sample
  73. Created: "sample/sys.config"
  74. Created: "sample/apps/sample/priv/static/spa/index.htm"
  75. Created: "sample/apps/sample/rebar.config"
  76. Created: "sample/apps/sample/priv/templates/index.html"
  77. Created: "sample/apps/sample/src/sample.erl"
  78. Created: "sample/rebar.config"
  79. Created: "sample/apps/sample/src/index.erl"
  80. Created: "sample/apps/rebar.config"
  81. Created: "sample/vm.args"
  82. Created: "sample/apps/sample/src/sample.app.src"
  83. Created: "sample/apps/sample/priv/static/synrc.css"
  84. Created: "sample/apps/sample/src/routes.erl"
  85. OK
  86. </code></figure>
  87. <div>
  88. <ul>
  89. <li><b><a href="man/mad_static.htm">mad_static</a></b> &mdash; MAD Static<div class=desk>: SKELETONS, MINIFIER</div></li>
  90. </ul>
  91. </div>
  92. </section>
  93. <section>
  94. <a name=docs><h3>DEPS</h3></a>
  95. <div>
  96. <figure><code>
  97. $ cd sample
  98. $ cat rebar.config
  99. {sub_dirs,["apps"]}.
  100. {deps_dir,"deps"}.
  101. {deps, [
  102. {erlydtl,".*", {git, "git://github.com/voxoz/erlydtl", [] }},
  103. {cowboy, ".*", {git, "git://github.com/voxoz/cowboy", [] }},
  104. {gproc, ".*", {git, "git://github.com/voxoz/gproc", [] }},
  105. {fs, ".*", {git, "git://github.com/synrc/fs", {tag, "4.10"} }},
  106. {sh, ".*", {git, "git://github.com/synrc/sh", {tag, "2.10"} }},
  107. {mad, ".*", {git, "git://github.com/synrc/mad", {tag, "4.10"} }},
  108. {active, ".*", {git, "git://github.com/synrc/active", {tag, "4.10"} }},
  109. {nitro, ".*", {git, "git://github.com/synrc/nitro", {tag, "3.10"} }},
  110. {n2o, ".*", {git, "git://github.com/synrc/n2o", {tag, "5.10"} }}
  111. ]}
  112. </code></figure>
  113. <figure><code>
  114. $ mad deps
  115. ==> dependency: "git://github.com/voxoz/erlydtl" tag: []
  116. ==> dependency: "git://github.com/voxoz/cowlib" tag: []
  117. ==> dependency: "git://github.com/voxoz/ranch" tag: []
  118. ==> dependency: "git://github.com/voxoz/gproc" tag: []
  119. ==> dependency: "git://github.com/synrc/fs" tag: {tag,"4.10"}
  120. ==> dependency: "git://github.com/synrc/sh" tag: {tag,"2.10"}
  121. ==> dependency: "git://github.com/synrc/mad" tag: {tag,"4.10"}
  122. ==> dependency: "git://github.com/synrc/active" tag: {tag,"4.10"}
  123. ==> dependency: "git://github.com/synrc/nitro" tag: {tag,"3.10"}
  124. ==> dependency: "git://github.com/synrc/n2o" tag: {tag,"5.10"}
  125. OK
  126. </code></figure>
  127. </div>
  128. <a name=docs><h3>GET</h3></a>
  129. <figure><code>
  130. $ mad get kvx
  131. ==> dependency: "https://github.com/synrc/kvx" tag: []
  132. OK
  133. </code></figure>
  134. <a name=docs><h3>UP</h3></a>
  135. <figure><code>
  136. $ mad up
  137. OK
  138. </code></figure>
  139. <div>
  140. <ul>
  141. <li><b><a href="man/mad_git.htm">mad_git</a></b> &mdash; MAD Git</div></li>
  142. </ul>
  143. </div>
  144. </section>
  145. <section>
  146. <a name=docs><h3>CLEAN</h3></a>
  147. <div>
  148. <figure><code>
  149. $ mad clean
  150. OK
  151. </code></figure>
  152. </div>
  153. <a name=docs><h3>START</h3></a>
  154. <figure><code>
  155. $ mad start
  156. Scripting: "/Users/maxim/depot/synrc/mad/mad"
  157. OK
  158. </code></figure>
  159. <a name=docs><h3>ATTACH</h3></a>
  160. <figure><code>
  161. $ $(mad attach)
  162. Attaching to . (^D to exit)
  163. 1>
  164. </code></figure>
  165. <a name=docs><h3>STOP</h3></a>
  166. <div>
  167. <ul>
  168. <li><b><a href="man/mad_run.htm">mad_run</a></b> &mdash; MAD Runner</div></li>
  169. </ul>
  170. </div>
  171. </section>
  172. <section>
  173. <a name=docs><h3>COMPILE</h3></a>
  174. <figure><code>
  175. $ mad compile
  176. Writing /apps/sample/ebin/sample.app
  177. OK
  178. </code></figure>
  179. <div>
  180. <ul>
  181. <li><b><a href="man/mad_compile.htm">mad_compile</a></b> &mdash; MAD Compiler</li>
  182. <li><b><a href="man/mad_app.htm">mad_app</a></b> &mdash; OTP Application files</li>
  183. <li><b><a href="man/mad_cubical.htm">mad_cubical</a></b> &mdash; cubicaltt files</li>
  184. <li><b><a href="man/mad_dtl.htm">mad_dtl</a></b> &mdash; DTL files</li>
  185. <li><b><a href="man/mad_erl.htm">mad_erl</a></b> &mdash; Erlang source files</li>
  186. <li><b><a href="man/mad_leex.htm">mad_leex</a></b> &mdash; Erlang leex files</li>
  187. <li><b><a href="man/mad_yecc.htm">mad_yecc</a></b> &mdash; Erlang yecc files</li>
  188. <li><b><a href="man/mad_port.htm">mad_port</a></b> &mdash; C/C++ files</li>
  189. <li><b><a href="man/mad_script.htm">mad_script</a></b> &mdash; .script files</li>
  190. </ul>
  191. </div>
  192. </section>
  193. <section>
  194. <a name=docs><h3>PLAN</h3></a>
  195. <figure><code>
  196. $ mad plan
  197. OK
  198. </code></figure>
  199. <a name=docs><h3>STRIP</h3></a>
  200. <figure><code>
  201. $ mad strip
  202. OK
  203. </code></figure>
  204. <a name=docs><h3>BUNDLE</h3></a>
  205. <figure><code>
  206. $ mad bundle script sample
  207. OK
  208. </code></figure>
  209. <figure><code>
  210. $ mad bundle beam sample
  211. OK
  212. </code></figure>
  213. <div>
  214. <ul>
  215. <li><b><a href="man/mad_release.htm">mad_release</a></b> &mdash; MAD Bundler</li>
  216. <li><b><a href="man/mad_escript.htm">mad_escript</a></b> &mdash; MAD escript bundler</li>
  217. <li><b><a href="man/mad_systools.htm">mad_systools</a></b> &mdash; MAD BEAM release bundler</li>
  218. </ul>
  219. </div>
  220. </section>
  221. <section>
  222. <a name=docs><h3>REPL</h3></a>
  223. <figure><code>
  224. $ mad repl
  225. $ open http://127.0.0.1:8001/app/index.htm
  226. </code></figure>
  227. <div>
  228. <ul>
  229. <li><b><a href="man/mad_repl.htm">mad_repl</a></b> &mdash; MAD REPL</div></li>
  230. </ul>
  231. </div>
  232. </section>
  233. <section>
  234. <a name=docs><h3>Related Documents</h3></a>
  235. <div>
  236. <ul>
  237. <li><a href="https://n2o.space/articles/n2o.htm">N2O: PROTOCOL</a></li>
  238. <li><a href="https://n2o.space/articles/web.htm">N2O: SERVER</a></li>
  239. <li><a href="https://n2o.space/articles/history.htm">N2O: HISTORY</a></li>
  240. </ul></div>
  241. </section>
  242. </main>
  243. <footer>
  244. Made with <span class="heart">❤</span> to N2O
  245. </footer>
  246. </body>
  247. </html>