index.html 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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://n2o.dev/blank.css"/>
  10. <link rel="stylesheet" href="https://n2o.dev/zima.css"/>
  11. </head>
  12. <body>
  13. <nav>
  14. <a href="https://n2o.dev">DEV</a>
  15. <a href="#" style="background:#ededed;">MAD</a>
  16. <div class="dropdown">
  17. <a onclick="drop()" class="dropbtn">EN</a>
  18. <div id="dropdown" class="dropdown-content">
  19. <a href="https://n2o.dev/deps/mad/man/ua/index.html">UA</a>
  20. <a href="https://mad.n2o.dev/">EN</a>
  21. </div>
  22. </div>
  23. </nav>
  24. <header>
  25. <a href="https://github.com/synrc/mad">
  26. <img src="https://openmoji.org/data/color/svg/26A1.svg"/></a>
  27. <h1>MAD</h1>
  28. </header>
  29. <aside>
  30. <article>
  31. <section>
  32. <h3>SYNOPSIS</h3>
  33. <div>MAD is a small and fast build tool for Erlang.
  34. Here is example of config file of MAD itself:</div><br/>
  35. <figure>
  36. <code>
  37. {deps_dir,"deps"}.
  38. {erl_opts,[nowarn_export_all]}.
  39. {deps,[{sh,".*",{git,
  40. "git://github.com/synrc/sh",
  41. {branch, "master"}}}]}.
  42. </code>
  43. </figure><br/>
  44. </section>
  45. <section>
  46. <a name="install"></a><h3>INSTALL</h3>
  47. <div>Place MAD binary into <b>$PATH</b> or
  48. <b>/usr/local/bin</b>. E.g. using curl:</div><br/>
  49. <figure>
  50. <code> $ curl -fsSL \
  51. https://git.io/fpYm4 \
  52. > mad &#38;&#38; chmod +x mad \
  53. &#38;&#38; sudo cp mad /usr/local/bin</code>
  54. </figure><br/>
  55. <div>
  56. JAN 2020 © <a href="https://github.com/5HT">Namdak Tonpa</a> ISC<br/>
  57. VER 7.1 6.8 5.4
  58. </div>
  59. </section>
  60. </article>
  61. </aside><main>
  62. <section>
  63. <h3>HELP</h3>
  64. <p> MAD accepts a list of words.
  65. This list of words contains special words aka delimiters or commands.
  66. Words between commands are arguments for the nearest command from left.
  67. </p>
  68. <figure><code>
  69. MAD Manage Dependencies 5.4-14-g7810b8d
  70. invoke = mad | mad list
  71. list = [] | command [options] list
  72. command = app [zero|nitro] <name> | deps | clean | compile | strip
  73. | bundle [beam|script] <name> | man | get <repo> | up [name]
  74. | start | stop | attach | repl | static <min>
  75. </min></repo></name></name></code></figure>
  76. <div>
  77. <ul><li><b><a href="man/mad.htm">mad</a></b> — MAD Main Module</li><li><b><a href="man/mad_local.htm">mad_local</a></b> — MAD POSIX Profile</li></ul>
  78. </div>
  79. </section>
  80. <section>
  81. <a name="app"></a><h3>APP</h3>
  82. <p>Create predefined sample application.
  83. MAD has built-in two sample applications: <b>zero</b> and <b>nitro</b>.
  84. Here is bluepring of <b>zero</b> application:</p>
  85. <figure><code>
  86. $ mad app zero sample
  87. OK
  88. </code></figure>
  89. <p>sample.app.src</p>
  90. <figure><code>
  91. {application, sample,
  92. [{description, "sample application"},
  93. {vsn, "0.8.0"},
  94. {registered, []},
  95. {applications, [kernel,stdlib]},
  96. {mod, { sample, []}},
  97. {env, []}]}.
  98. </code></figure>
  99. <p>sample.erl</p>
  100. <figure><code>
  101. -module(sample).
  102. -compile(export_all).
  103. -behaviour(application).
  104. -behaviour(supervisor).
  105. -export([start/2, stop/1, init/1]).
  106. start(_, _) -> supervisor:start_link({local, ?MODULE}, ?MODULE, []).
  107. stop(_) -> ok.
  108. init([]) -> {ok, { {one_for_one, 5, 10}, []} }.
  109. </code></figure>
  110. <div>
  111. <ul><li><b><a href="man/mad_static.htm">mad_static</a></b> — MAD Static</li></ul>
  112. </div>
  113. </section>
  114. <section>
  115. <a name="deps"></a><h3>DEPS</h3>
  116. <div>
  117. <figure><code>
  118. $ cd sample
  119. $ cat rebar.config
  120. {sub_dirs,["apps"]}.
  121. {deps_dir,"deps"}.
  122. {deps, [
  123. {erlydtl,".*", {git, "git://github.com/voxoz/erlydtl", [] }},
  124. {cowboy, ".*", {git, "git://github.com/voxoz/cowboy", [] }},
  125. {gproc, ".*", {git, "git://github.com/voxoz/gproc", [] }},
  126. {fs, ".*", {git, "git://github.com/synrc/fs", {tag, "4.10"} }},
  127. {sh, ".*", {git, "git://github.com/synrc/sh", {tag, "2.10"} }},
  128. {mad, ".*", {git, "git://github.com/synrc/mad", {tag, "4.10"} }},
  129. {active, ".*", {git, "git://github.com/synrc/active", {tag, "4.10"} }},
  130. {nitro, ".*", {git, "git://github.com/synrc/nitro", {tag, "3.10"} }},
  131. {n2o, ".*", {git, "git://github.com/synrc/n2o", {tag, "5.10"} }}
  132. ]}
  133. </code></figure>
  134. <figure><code>
  135. $ mad deps
  136. ==> dependency: "git://github.com/voxoz/erlydtl" tag: []
  137. ==> dependency: "git://github.com/voxoz/cowlib" tag: []
  138. ==> dependency: "git://github.com/voxoz/ranch" tag: []
  139. ==> dependency: "git://github.com/voxoz/gproc" tag: []
  140. ==> dependency: "git://github.com/synrc/fs" tag: {tag,"4.10"}
  141. ==> dependency: "git://github.com/synrc/sh" tag: {tag,"2.10"}
  142. ==> dependency: "git://github.com/synrc/mad" tag: {tag,"4.10"}
  143. ==> dependency: "git://github.com/synrc/active" tag: {tag,"4.10"}
  144. ==> dependency: "git://github.com/synrc/nitro" tag: {tag,"3.10"}
  145. ==> dependency: "git://github.com/synrc/n2o" tag: {tag,"5.10"}
  146. OK
  147. </code></figure>
  148. </div>
  149. <a name="get"></a><h3>GET</h3>
  150. <figure><code>
  151. $ mad get kvx
  152. ==> dependency: "https://github.com/synrc/kvx" tag: []
  153. OK
  154. </code></figure>
  155. <a name="up"></a><h3>UP</h3>
  156. <figure><code>
  157. $ mad up
  158. OK
  159. </code></figure>
  160. <div>
  161. <ul><li><b><a href="man/mad_git.htm">mad_git</a></b> — MAD Git</li></ul></div>
  162. </section>
  163. <section>
  164. <a name="clean"></a><h3>CLEAN</h3>
  165. <div>
  166. <figure><code>
  167. $ mad clean
  168. OK
  169. </code></figure>
  170. </div>
  171. <a name="start"></a><h3>START</h3>
  172. <figure><code>
  173. $ mad start
  174. Scripting: "/Users/maxim/depot/synrc/mad/mad"
  175. OK
  176. </code></figure>
  177. <a name="attach"></a><h3>ATTACH</h3>
  178. <figure><code>
  179. $ $(mad attach)
  180. Attaching to . (^D to exit)
  181. 1>
  182. </code></figure>
  183. <a name="stop"></a><h3>STOP</h3>
  184. <figure><code>
  185. $ eval $(mad stop)
  186. Attaching to . (^D to exit)
  187. [EOF]
  188. </code></figure>
  189. <div>
  190. <ul><li><b><a href="man/mad_run.htm">mad_run</a></b> — MAD Runner</li></ul></div>
  191. </section>
  192. <section>
  193. <a name="compile"></a><h3>COMPILE</h3>
  194. <figure><code>
  195. $ mad compile
  196. Writing /apps/sample/ebin/sample.app
  197. OK
  198. </code></figure>
  199. <div>
  200. <ul><li><b><a href="man/mad_compile.htm">mad_compile</a></b> — MAD Compiler</li><li><b><a href="man/mad_app.htm">mad_app</a></b> — OTP Application files</li><li><b><a href="man/mad_cubical.htm">mad_cubical</a></b> — cubicaltt files</li><li><b><a href="man/mad_dtl.htm">mad_dtl</a></b> — DTL files</li><li><b><a href="man/mad_erl.htm">mad_erl</a></b> — Erlang source files</li><li><b><a href="man/mad_leex.htm">mad_leex</a></b> — Erlang leex files</li><li><b><a href="man/mad_yecc.htm">mad_yecc</a></b> — Erlang yecc files</li><li><b><a href="man/mad_port.htm">mad_port</a></b> — C/C++ files</li><li><b><a href="man/mad_script.htm">mad_script</a></b> — .script files</li></ul>
  201. </div>
  202. </section>
  203. <section>
  204. <a name="plan"></a><h3>PLAN</h3>
  205. <figure><code>
  206. $ mad plan
  207. OK
  208. </code></figure>
  209. <a name="strip"></a><h3>STRIP</h3>
  210. <figure><code>
  211. $ mad strip
  212. OK
  213. </code></figure>
  214. <a name="bundle"></a><h3>BUNDLE</h3>
  215. <figure><code>
  216. $ mad bundle script sample
  217. OK
  218. </code></figure>
  219. <figure><code>
  220. $ mad bundle beam sample
  221. OK
  222. </code></figure>
  223. <div>
  224. <ul><li><b><a href="man/mad_release.htm">mad_release</a></b> — MAD Bundler</li><li><b><a href="man/mad_escript.htm">mad_escript</a></b> — MAD escript bundler</li><li><b><a href="man/mad_systools.htm">mad_systools</a></b> — MAD BEAM release bundler</li></ul>
  225. </div>
  226. </section>
  227. <section>
  228. <a name="repl"></a><h3>REPL</h3>
  229. <figure><code>
  230. $ mad repl
  231. $ open http://127.0.0.1:8001/app/index.htm
  232. </code></figure>
  233. <div>
  234. <ul><li><b><a href="man/mad_repl.htm">mad_repl</a></b> — MAD REPL</li></ul></div>
  235. </section>
  236. <section>
  237. <a name="articles"></a><h3>ARTICLES</h3>
  238. <div>
  239. <ul><li><a href="https://n2o.dev/articles/n2o.htm">N2O: PROTOCOL</a></li>
  240. <li><a href="https://n2o.dev/articles/web.htm">N2O: SERVER</a></li>
  241. <li><a href="https://n2o.dev/articles/history.htm">N2O: HISTORY</a></li></ul></div>
  242. </section>
  243. </main><footer>
  244. Made with <span class="heart">❤</span> to N2O
  245. </footer>
  246. <script>function drop(){document.getElementById("dropdown").classList.toggle("show");}</script>
  247. </body></html>