Browse Source

mv docs to docs repo

221V 1 year ago
parent
commit
75fd2cb2cf
19 changed files with 0 additions and 1128 deletions
  1. 0 16
      doc/book.tex
  2. 0 158
      doc/bundles.tex
  3. 0 111
      doc/commands.tex
  4. 0 70
      doc/config.tex
  5. 0 65
      doc/deps.tex
  6. 0 90
      doc/hevea.sty
  7. 0 75
      doc/index.tex
  8. 0 68
      doc/setup.tex
  9. 0 137
      doc/synrc.tex
  10. 0 17
      doc/web/bundles.tex
  11. 0 17
      doc/web/commands.tex
  12. 0 17
      doc/web/config.tex
  13. 0 17
      doc/web/deps.tex
  14. 0 18
      doc/web/index.tex
  15. 0 17
      doc/web/ports.tex
  16. 0 17
      doc/web/scripts.tex
  17. 0 17
      doc/web/setup.tex
  18. 0 11
      doc/web/toc.tex
  19. 0 190
      index.html

+ 0 - 16
doc/book.tex

@@ -1,16 +0,0 @@
-% copyright (c) 2013 Synrc Research Center
-
-\documentclass[8pt,twoside]{article}
-\input{synrc.tex}
-\begin{document}
-\titleMAD
-\tableofcontents
-\include{index}
-\include{setup}
-\include{config}
-\include{commands}
-\include{scripts}
-\include{deps}
-\include{bundles}
-\include{ports}
-\end{document}

+ 0 - 158
doc/bundles.tex

@@ -1,158 +0,0 @@
-\section{Container Bundles}
-
-\subsection{ESCRIPT Bundles}
-
-The key feature of mad is ability to create single-file bundled web sites.
-Thus making dream to boot simpler than node.js come true.
-This bundle target is ready to run on Windows, Linux and Mac.
-
-To make this possible we implemented a zip filesytem inside escript.
-mad packages priv directories along with ebin and configs.
-You can redefine each file in zip fs inside target
-escript by creation the copy with same path locally near escript.
-After launch all files are copied to ETS.
-N2O also comes with custom cowboy static handler that is able to
-read static files from this cached ETS filesystem.
-Also bundle are compatible with active online realoading and recompilation.
-
-E.g. you main create a single file site with:
-
-\vspace{1\baselineskip}
-\begin{lstlisting}
-    # mad bundle app_name
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-app\_name shoul be the same as a valid Erlang module, with app\_module:main/1
-function defined, which will boot up the bundle. This function could be like that:
-
-\vspace{1\baselineskip}
-\begin{lstlisting}
-     -module(app_name).
-
-     main(Params) ->
-          RebarConfig = [],
-          mad_repl:main(Params,RebarConfig).
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-\subsection{BEAM ERTS Releases}
-
-As you may know you can create OTP releases with
-reltool (rebar generate) or systools (relx). mad creates releases boot
-script with systools and pack tra by itself.
-
-\vspace{1\baselineskip}
-\begin{lstlisting}
-    # mad release beam sample
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-\subsection{LING Unikernels}
-
-Sample rebar.config for your application you want to go unikernel:
-
-\vspace{1\baselineskip}
-\begin{lstlisting}
-    {deps_dir,"deps"}.
-    {deps, [{ling,"master"},{sh,"1.9"}]}.
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-Now you should build LING/posix:
-
-\vspace{1\baselineskip}
-\begin{lstlisting}
-    $ mad dep
-    $ cd deps/ling
-    $ ARCH=posix make
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-Now pack vmling.o, your OTP apps and rest static to single-file LING bundle with VM inside.
-
-\vspace{1\baselineskip}
-\begin{lstlisting}
-    $ mad release ling mad
-    Ling Params: []
-    ARCH: posix_x86
-    Bundle Name: mad
-    System: [compiler,syntax_tools,sasl,tools,mnesia,reltool,xmerl,crypto,kernel,
-             stdlib,wx,webtool,ssl,runtime_tools,public_key,observer,inets,asn1,
-             et,eunit,hipe,os_mon]
-    Apps: [kernel,stdlib,sh,mad]
-    Overlay: ["crypto.beam","9p.beam","9p_auth.beam","9p_info.beam",
-              "9p_mounter.beam","9p_server.beam","9p_tcp.beam","9p_zero.beam",
-              "disk.beam","disk_server.beam","embedded_export.beam",
-              "goo_export.beam","goofs.beam","hipe_unified_loader.beam",
-              "inet_config.beam","kernel.beam","ling_bifs.beam","ling_code.beam",
-              "ling_disasm.beam","ling_iops.beam","ling_iopvars.beam",
-              "ling_lib.beam","net_vif.beam","os.beam","prim_file.beam",
-              "user_drv.beam","os_mon.beam","dets.beam","filename.beam",
-              "maps.beam","unicode.beam","zlib.beam"]
-    Bucks: [{boot,"/boot",2},
-            {os_mon,"/erlang/lib/os_mon/ebin",1},
-            {crypto,"/erlang/lib/crypto/ebin",1},
-            {kernel,"/erlang/lib/kernel/ebin",90},
-            {stdlib,"/erlang/lib/stdlib/ebin",85},
-            {sh,"/erlang/lib/sh/ebin",6},
-            {mad,"/erlang/lib/mad/ebin",43}]
-    Initializing EMBED.FS:
-    Mount View:
-     /boot /boot
-    /erlang/lib/os_mon/ebin /os_mon
-    /erlang/lib/crypto/ebin /crypto
-    /erlang/lib/kernel/ebin /kernel
-    /erlang/lib/stdlib/ebin /stdlib
-    /erlang/lib/sh/ebin /sh
-    /erlang/lib/mad/ebin /mad
-    Creating EMBED.FS C file: ...ok
-    Compilation of Filesystem object: ...ok
-    Linking Image: ok
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-Run it:
-
-\vspace{1\baselineskip}
-\begin{lstlisting}
-    $ rlwrap ./image.img
-    Erlang [ling-0.5]
-
-    Eshell V6.3  (abort with ^G)
-    1> application:which_applications().
-    [{mad,"MAD VXZ Build Tool","2.2"},
-     {sh,"VXZ SH Executor","0.9"},
-     {stdlib,"ERTS  CXC 138 10","2.2"},
-     {kernel,"ERTS  CXC 138 10","3.0.3"}]
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-\subsection{Docker-compatible RUNC Containers}
-
-Creating runc-complatible container is simple:
-
-\vspace{1\baselineskip}
-\begin{lstlisting}
-    # mad release runc sample
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-\subsection{Makefiles with OTP.MK}
-
-OTP.MK is a tiny 50 lines Makefile that allows to start your set
-of application using run\_erl and to\_erl tools from OTP distribution.
-We use that way in poduction. This is the best option also in
-development mode because all directory structure is open and mutable,
-so you can reload modified files and perform recompilation on the fly.
-
-It uses the original code to fast resolve dependencies into the right
-boot sequence to start. If you want more powerful Makefile-based erlang
-package management you may take a look onto ERLANG.MK by Nine Nines.
-
-\vspace{1\baselineskip}
-\begin{lstlisting}
-    # make console
-\end{lstlisting}
-\vspace{1\baselineskip}
-

+ 0 - 111
doc/commands.tex

@@ -1,111 +0,0 @@
-\section{Commands}
-
-Synrc mad has a simple interface as follows:
-
-\vspace{1\baselineskip}
-\begin{lstlisting}
-  MAD Container Tool version b547fa
-
-      invoke = mad params
-      params = [] | command [ options  ] params
-     command = app     | deps  | clean | compile | up
-             | release [ beam  | ling  | script  | runc ]
-             | deploy  | start | stop  | attach  | sh
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-It seems to us more natural, you can specify random
-commands set with different specifiers (options).
-
-\subsection{deps, dep}
-
-In rebar-like managers we are selecting deps from rebar.config:
-\vspace{1\baselineskip}
-\begin{lstlisting}
-  {sub_dirs,["apps"]}.
-  {deps_dir,"deps"}.
-  {deps, [active,{nitro,"2.9"},{n2o,"2.9"}]}.
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-The search sequence for dependecies is follows. First mad will try to
-reach global package repository at \footahref{http://synrc.com/apps/index.txt}{http://synrc.com/apps/index.txt},
-this address is configurable. No application server is required for mad
-package management, only static files with OTP application format.
-
-\vspace{1\baselineskip}
-\begin{lstlisting}
-  {application,bpe,
-      [{description,"BPE SRC Business Process Engine"},
-       {vsn,"1.9"},
-       {registered,[]},
-       {applications,[kernel,stdlib,kvs,n2o]},
-       {dependencies,[kernel,stdlib,fs,ranch,crypto,mnesia,
-                      gproc,cowlib,kvs,cowboy,n2o,active,
-                      jsone,mad,nitro,sh,bpe]},
-       {mod,{bpe_app,[]}},
-       {env,[]},
-       {modules,[bpe,bpe_app,bpe_date,bpe_event,bpe_metainfo,bpe_proc,
-                 bpe_sup,bpe_task,default_railing,log_allow,routes,
-                 sampleproc,sampleproc_process]}]}.
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-If no file is found or server is unavailable then application registry will
-be taken from mad built-in index.txt. If no luck then the name of application,
-e.g. "spawnproc/rete" will be interpreted as github repository address.
-
-\vspace{1\baselineskip}
-\begin{lstlisting}
-   $ mad dep active n2o kvs ling "spawnproc/rete"
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-\subsection{compile, com}
-Performs compilation of all known compilations backends in complilation profile of mad:
-\vspace{1\baselineskip}
-\begin{lstlisting}
-    app — app.src erlang templating
-    dtl — DTL compiler
-    erl — BEAM compiler
-    c/c++ — for gcc cland and other native compilation
-    script — .script file used in projects like gproc
-    yrl/xrl — DSL language parser compilers
-    upl — UPL compiler
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-\subsection{release, rel, bundle, bun}
-Taking all dependecies and resolve boot sequence according to dependecy order.
-Storing this value in .applist. If release type is not defined ({\bf beam} in following example),
-then {\bf script} release will be taken as a default.
-\vspace{1\baselineskip}
-\begin{lstlisting}
-    $ mad release beam sample
-    Ordered: [kernel,stdlib,fs,ranch,crypto,compiler,syntax_tools,
-              gproc,cowlib,cowboy,n2o,sample,active,erlydtl,jsone,
-              mad,nitro,sh]
-    *WARNING* : Missing application sasl. Can not upgrade with this release
-    sample.boot: ok
-    OK:  "sample"
-
-    $ mad rel mad
-    Ordered: [kernel,stdlib,inets,sh,mad]
-    OK:  "mad"
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-MAD supports several releasing backends:
-
-\vspace{1\baselineskip}
-\begin{lstlisting}
-    script — script bundles, like mad itself
-    beam — ERTS releases with systools
-    ling — LING portable unikernels
-    runc — Docker-compatible containers
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-\subsection{sh, repl, rep}
-
-Start REPL shell session.

+ 0 - 70
doc/config.tex

@@ -1,70 +0,0 @@
-\section{Configuration File}
-
-\subsection{rebar.config}
-
-mad uses {\bf rebar.config} filename to load mad configuration.
-Despite mad is no fully rebar compatible (e.g. it can't uses
-rebar plugins, ports compilation is rather different, etc),
-it uses its name to achive certail level of compatibility.
-
-\subsection{deps}
-
-deps is the core option of mad. It says which OTP applications
-shold be used and where they could be found. Yoy may also specify
-versions. Here is simpliest example:
-
-\vspace{1\baselineskip}
-\begin{lstlisting}[caption=deps Option]
-    {deps, [
-             {kvs,   ".*", {git,"git://github.com/synrc/kvs"}},
-             {forms, ".*", {git,"git://github.com/spawnproc/forms"}}
-    ]}.
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-\subsection{deps\_dir}
-
-To specify where deps should be stored after fetching inside
-your application you use deps\_dir option:
-
-\vspace{1\baselineskip}
-\begin{lstlisting}[caption=deps\_dir Option]
-    {deps_dir, "deps"}.
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-\subsection{sub\_dirs}
-
-If your application consist of more than one src
-directory, you may specify all of the sub-applications.
-Each sub-application should be valid OTP application
-with its own rebar.config configuration file.
-
-\vspace{1\baselineskip}
-\begin{lstlisting}
-    {sub_dirs,["apps"]}.
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-\subsection{lib\_dirs}
-
-To use include directive across your sub-applications
-you should specify the {\bf lib\_dirs} directories
-which will be settled as include directories during compilation.
-
-\vspace{1\baselineskip}
-\begin{lstlisting}
-    {lib_dirs,["apps"]}.
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-E.g. you have my\_app and my\_server applications
-inside apps directory and you including HRL file
-from my\_server application from ap\_app application:
-
-\vspace{1\baselineskip}
-\begin{lstlisting}
-    -module(my_app).
-    -include_lib("my_server/include/my_server.hrl").
-\end{lstlisting}
-\vspace{1\baselineskip}

+ 0 - 65
doc/deps.tex

@@ -1,65 +0,0 @@
-\section{Dependencies}
-
-\subsection{OTP Compliant}
-
-mad supports app files inside ebin, priv static folder and c_src ports directories points.
-Specifically two kinds of directory layouts:
-
-\vspace{1\baselineskip}
-\begin{lstlisting}[caption=Solution]
-    +-- apps
-    +-- deps
-    +-- rebar.config
-    +-- sys.config
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-\vspace{1\baselineskip}
-\begin{lstlisting}[caption=OTP Application]
-    +-- deps
-    +-- ebin
-    +-- include
-    +-- priv
-    +-- src
-    +-- rebar.config
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-\subsection{Application Depot}
-
-As you may know you can create OTP releases systools from sasl application.
-mad currently creates releases with systools, but manually manages binary access:
-from local erlang or public applcation depot.
-
-To bundle binary BEAM or LING along with synrc spplications MAD can use
-global repository statically avaliable at Github Pages:
-
-\vspace{1\baselineskip}
-\begin{lstlisting}
-
-  $ curl -X GET http://synrc.com/apps/index.txt
-  [ {bin,[beam],     ["7.0.3"]},
-    {lib,[active],   ["0.9"]},
-    {lib,[compiler], ["6.0"]},
-    {lib,[cowboy],   ["1.0.1"]},
-    {lib,[cowlib],   ["1.0.0"]},
-    {lib,[crypto],   ["3.6"]},
-    {lib,[erlydtl],  ["0.8.0"]},
-    {lib,[fs],       ["1.9"]},
-    {lib,[gproc],    ["0.3"]},
-    {lib,[jsone],    ["v0.3.3"]},
-    {lib,[kernel],   ["4.0"]},
-    {lib,[stdlib],   ["2.5"]},
-    {lib,[kvs],      ["2.9"]},
-    {lib,[mad],      ["2.9"]},
-    {lib,[mnesia],   ["4.13"]},
-    {lib,[n2o],      ["2.10"]},
-    {lib,[nitro],    ["0.9"]},
-    {lib,[ranch],    ["1.0.0"]},
-    {lib,[rest],     ["2.9"]},
-    {lib,[review],   ["2.9"]},
-    {lib,[sh],       ["1.9"]},
-    {lib,[syntax_tools], ["1.7"]} ].
-
-\end{lstlisting}
-\vspace{1\baselineskip}

+ 0 - 90
doc/hevea.sty

@@ -1,90 +0,0 @@
-% hevea  : hevea.sty
-% This is a very basic style file for latex document to be processed
-% with hevea. It contains definitions of LaTeX environment which are
-% processed in a special way by the translator. 
-%  Mostly :
-%     - latexonly, not processed by hevea, processed by latex.
-%     - htmlonly , the reverse.
-%     - rawhtml,  to include raw HTML in hevea output.
-%     - toimage, to send text to the image file.
-% The package also provides hevea logos, html related commands (ahref
-% etc.), void cutting and image commands.
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{hevea}[2002/01/11]
-\RequirePackage{comment}
-\newif\ifhevea\heveafalse
-\@ifundefined{ifimagen}{\newif\ifimagen\imagenfalse}
-\makeatletter%
-\newcommand{\heveasmup}[2]{%
-\raise #1\hbox{$\m@th$%
-  \csname S@\f@size\endcsname
-  \fontsize\sf@size 0%
-  \math@fontsfalse\selectfont
-#2%
-}}%
-\DeclareRobustCommand{\hevea}{H\kern-.15em\heveasmup{.2ex}{E}\kern-.15emV\kern-.15em\heveasmup{.2ex}{E}\kern-.15emA}%
-\DeclareRobustCommand{\hacha}{H\kern-.15em\heveasmup{.2ex}{A}\kern-.15emC\kern-.1em\heveasmup{.2ex}{H}\kern-.15emA}%
-\DeclareRobustCommand{\html}{\protect\heveasmup{0.ex}{HTML}}
-%%%%%%%%% Hyperlinks hevea style
-\newcommand{\ahref}[2]{{#2}}
-\newcommand{\ahrefloc}[2]{{#2}}
-\newcommand{\aname}[2]{{#2}}
-\newcommand{\ahrefurl}[1]{\texttt{#1}}
-\newcommand{\footahref}[2]{#2\footnote{\texttt{#1}}}
-\newcommand{\mailto}[1]{\texttt{#1}}
-\newcommand{\imgsrc}[2][]{}
-\newcommand{\home}[1]{\protect\raisebox{-.75ex}{\char126}#1}
-\AtBeginDocument
-{\@ifundefined{url}
-{%url package is not loaded
-\let\url\ahref\let\oneurl\ahrefurl\let\footurl\footahref}
-{}}
-%% Void cutting instructions
-\newcounter{cuttingdepth}
-\newcommand{\tocnumber}{}
-\newcommand{\notocnumber}{}
-\newcommand{\cuttingunit}{}
-\newcommand{\cutdef}[2][]{}
-\newcommand{\cuthere}[2]{}
-\newcommand{\cutend}{}
-\newcommand{\htmlhead}[1]{}
-\newcommand{\htmlfoot}[1]{}
-\newcommand{\htmlprefix}[1]{}
-\newenvironment{cutflow}[1]{}{}
-\newcommand{\cutname}[1]{}
-\newcommand{\toplinks}[3]{}
-\newcommand{\setlinkstext}[3]{}
-\newcommand{\flushdef}[1]{}
-\newcommand{\footnoteflush}[1]{}
-%%%% Html only
-\excludecomment{rawhtml}
-\newcommand{\rawhtmlinput}[1]{}
-\excludecomment{htmlonly}
-%%%% Latex only
-\newenvironment{latexonly}{}{}
-\newenvironment{verblatex}{}{}
-%%%% Image file stuff
-\def\toimage{\endgroup}
-\def\endtoimage{\begingroup\def\@currenvir{toimage}}
-\def\verbimage{\endgroup}
-\def\endverbimage{\begingroup\def\@currenvir{verbimage}}
-\newcommand{\imageflush}[1][]{}
-%%% Bgcolor definition
-\newsavebox{\@bgcolorbin}
-\newenvironment{bgcolor}[2][]
-  {\newcommand{\@mycolor}{#2}\begin{lrbox}{\@bgcolorbin}\vbox\bgroup}
-  {\egroup\end{lrbox}%
-   \begin{flushleft}%
-   \colorbox{\@mycolor}{\usebox{\@bgcolorbin}}%
-   \end{flushleft}}
-%%% Style sheets macros, defined as no-ops
-\newcommand{\newstyle}[2]{}
-\newcommand{\addstyle}[1]{}
-\newcommand{\setenvclass}[2]{}
-\newcommand{\getenvclass}[1]{}
-\newcommand{\loadcssfile}[1]{}
-\newenvironment{divstyle}[1]{}{}
-\newenvironment{cellstyle}[2]{}{}
-\newif\ifexternalcss
-%%% Postlude
-\makeatother

+ 0 - 75
doc/index.tex

@@ -1,75 +0,0 @@
-\section{MAD: Erlang Containers}
-
-\subsection{Purpose}
-We were trying to make something minimalistic that fits out \footahref{https://github.com/synrc}{application stack}.
-The main idea of mad is to provide clean and simple rebar-like fast dependency manager that
-is able to build several types of packages and provides interface of containered deployments
-to virtualiezed environments.
-
-\subsection{Several Types of Packaging}
-The key feature of mad is ability to create single-file bundled web sites.
-This target escript is ready to run on Windows, Linux and Mac.
-
-\subsection{Deployment Options}
-As a deploy tool mad is also supposed to launch, start, stop and manage containers, locally or remote.
-You can make containers from different type of packages, like making runc container with beam release.
-
-\subsection{OTP Compliant}
-Mad supports ERTS boot files generation with systools and erlang application format used by OTP.
-This is the main format of application repository. Also boot files are suported on both LING and BEAM.
-
-\subsection{Tiny Size}
-And the good part:
-
-\vspace{1\baselineskip}
-\begin{lstlisting}
-                      Sources        Binary
-    mad               967 LOC        52 KB
-    rebar             7717 LOC       181 KB
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-\subsection{History}
-
-We came to conclusion that no matter how perfect your libraries are,
-the comfort and ease come mostly from developing tools.
-Everything got started when \footahref{https://github.com/proger}{Vladimir~Kirillov} decided to
-replace Rusty's sync beam reloader. As you know sync uses
-filesystem polling which is neither energy-efficient nor elegant. Also
-sync is only able to recompile separate modules while
-common use-case in N2O is to recompile DTL templates
-and LESS/SCSS stylesheets. That is why we need to recompile
-the whole project. That's the story how \footahref{https://github.com/synrc/active}{active} emerged.
-Under the hood active is a client subscriber
-of \footahref{https://github.com/synrc/fs}{fs} library, native filesystem listener for Linux, Windows and Mac.
-
-De-facto standard in Erlang world is rebar.
-We love rebar interface despite its implementation.
-First we plugged rebar into active and then decided to drop its support,
-it was slow, especially in cold recompilation.
-It was designed to be a stand-alone tool, so it has some
-glitches while using as embedded library.
-Later we switched to Makefile-based build tool \footahref{https://github.com/synrc/otp.mk}{otp.mk}.
-
-The idea to build rebar replacement was up in the air for a long time.
-The best minimal approach was picked up by \footahref{https://github.com/s1n4}{Sina~Samavati},
-who implemented the first prototype called 'mad'. Initially mad
-was able to compile DTL templates, YECC files, escript (like
-bundled in gproc), also it had support for caching with side-effects.
-In a month I forked mad and took over the development under the same name.
-
-\vspace{1\baselineskip}
-\begin{lstlisting}[caption=Example of building N2O sample]
-                                   Cold       Hot
-    rebar get-deps compile         53.156s    4.714s
-    mad deps compile               54.097s    0.899s
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-\vspace{1\baselineskip}
-\begin{lstlisting}[caption=Example of building Cowboy]
-                                   Hot
-    make (erlang.mk)               2.588s
-    mad compile                    2.521s
-\end{lstlisting}
-\vspace{1\baselineskip}

+ 0 - 68
doc/setup.tex

@@ -1,68 +0,0 @@
-\section{Setup}
-
-\subsection{Installing Binary}
-
-Fresh version of mad included as a binary in its primary github repository:
-
-\vspace{1\baselineskip}
-\begin{lstlisting}
-    # curl -fsSL https://raw.github.com/synrc/mad/master/mad > mad \
-              && chmod +x mad \
-              && sudo cp /usr/local/bin
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-Or you may want to add mad to your PATH.
-
-\subsection{Compiling Sources}
-
-If you want you can compile mad by yourself:
-
-\vspace{1\baselineskip}
-\begin{lstlisting}
-    # git clone http://github.com/synrc/mad \
-             && cd mad \
-             && make
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-Note that mad uses mad to build mad. It's mad.
-
-\subsection{Creating a sample N2O project}
-
-mad also comes with N2O templates. So you can bootstrap a N2O-based site
-just having a single copy of mad binary.
-
-\vspace{1\baselineskip}
-\begin{lstlisting}
-    # mad app sample
-    # cd sample
-    # mad deps compile release sample
-\end{lstlisting}
-\vspace{1\baselineskip}
-
-After that you can just run escript web\_app under Windows, Linux and
-Mac and open \footahref{http://localhost:8000}{http://localhost:8000}.
-
-\vspace{1\baselineskip}
-\begin{lstlisting}
-    C:\> escript sample
-    Applications: [kernel,stdlib,crypto,cowlib,ranch,
-                   cowboy,compiler,syntax_tools,
-                   erlydtl,gproc,xmerl,n2o,sample,
-                   fs,active,mad,sh]
-    Configuration: [{n2o,[{port,8000},
-                          {route,routes}]},
-                    {kvs,[{dba,store_mnesia},
-                          {schema,[kvs_user,
-                                   kvs_acl,
-                                   kvs_feed,
-                                   kvs_subscription]}]}]
-    Erlang/OTP 17 [erts-6.0] [64-bit] [smp:4:4]
-                  [async-threads:10] [kernel-poll:false]
-
-    Eshell V6.0  (abort with ^G)
-    1>
-\end{lstlisting}
-\vspace{1\baselineskip}
-

+ 0 - 137
doc/synrc.tex

@@ -1,137 +0,0 @@
-% Copyright (c) 2010 Synrc Research Center
-
-\usepackage{afterpage}
-
-\usepackage{hevea}
-\usepackage[english]{babel}
-\usepackage{palatino}
-\usepackage{graphicx}
-\usepackage{tocloft}
-\usepackage{cite}
-\usepackage[utf8]{inputenc}
-\usepackage{moreverb}
-\usepackage{listings}
-\usepackage[none]{hyphenat}
-\usepackage{caption}
-\usepackage[usenames,dvipsnames]{color}
-\usepackage[top=18mm, bottom=25.4mm,
-            inner=16mm,outer=18mm,
-            paperwidth=142mm, paperheight=200mm]{geometry}
-
-%left=18mm, right=18mm,
-
-% \usepackage[hmarginratio=3:2]{geometry}
-
-\hyphenation{framework nitrogen javascript facebook streaming JavaScript micro-frameworks}
-
-\setlength{\cftsubsecnumwidth}{2.5em}
-
-% include image for HeVeA and LaTeX
-
-\makeatletter
-\def\@seccntformat#1{\llap{\csname the#1\endcsname\hskip0.7em\relax}}
-\makeatother
-
-\newcommand{\includeimage}[2]
-{\ifhevea
-    {\imgsrc{#1}}
-\else{
-    \begin{figure}[h!]
-    \centering
-    \includegraphics[width=\textwidth]{#1}
-    \caption{#2}
-    \end{figure}}
-\fi}
-
-% HeVeA header
-
-{\ifhevea
-  \let\oldmeta=\@meta
-  \renewcommand{\@meta}{%
-  \oldmeta
-  \begin{rawhtml}
-  <meta name="Author" content="Maxim Sokhatsky">
-  <meta http-equiv="expires" content="Tue, 01 Jan 2020 1:00:00 GMT" />
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-  <meta http-equiv="X-UA-Compatible" content="IE=IE10,chrome=1" />
-  \end{rawhtml}}
-
-  \htmlhead{\rawhtmlinput{templates/head-hevea.htx}}
-  \htmlfoot{\rawhtmlinput{templates/foot.htx}}
-  \footerfalse
-\fi}
-
-% title page for N2O
-
-\newcommand*{\titleMAD}
-{
-    \begingroup
-   \thispagestyle{empty}
-    \hbox{
-        \hspace*{0.2\textwidth}
-        \rule{1pt}{\textheight}
-        \hspace*{0.05\textwidth}
-        \parbox[b]{0.75\textwidth}
-        {
-            {\noindent\Huge \bfseries MAD}\\[2\baselineskip]
-            {\LARGE \textsc{
-                Small and Fast\\[0.5\baselineskip]
-                Build Tool\\[0.5\baselineskip]
-                for Erlang Apps}}\\[4\baselineskip]
-            \vspace{0.5\textheight}
-%            {\Large \textit{Maxim Sokhatsky}}\\[2\baselineskip]
-%            {\large {\bf {\color{Blue}syn}{\color{OrangeRed}rc} research center}
-%            {\copyright} 2013-2014}\\[1\baselineskip]
-        }
-    }
-    \endgroup
-}
-
-% define images store
-
-\graphicspath{{./images/}}
-
-% start each section from new page
-
-\let\stdsection\section
-\renewcommand\section{\newpage\stdsection}
-
-% define style for code listings
-
-\lstset{
-    backgroundcolor=\color{white},
-    keywordstyle=\color{blue},
-    basicstyle=\bf\ttfamily\footnotesize,
-    columns=fixed}
-
-%\headsep = 0cm
-%\voffset = -1.5cm
-%\hoffset = -0.7cm
-%\topmargin = 0cm
-%\textwidth = 12cm
-%\textheight = 17.5cm
-%\footskip = 1cm
-%\parindent = 0cm
-
-\hyphenpenalty=5000
-  \tolerance=1000
-
-\newenvironment{dedication}
-{
-   \thispagestyle{empty}
-   \cleardoublepage
-   \thispagestyle{empty}
-   \vspace*{\stretch{1}}
-   \hfill\begin{minipage}[t]{0.66\textwidth}
-   \raggedright
-}%
-{
-   \end{minipage}
-   \vspace*{\stretch{3}}
-   \clearpage
-}
-
-\newcommand\blankpage{
-    \null
-    \thispagestyle{empty}
-    \newpage}

+ 0 - 17
doc/web/bundles.tex

@@ -1,17 +0,0 @@
-\input{../../../../synrc.hva}
-%HEVEA \loadcssfile{../../../../synrc.css}
-\renewcommand{\images}{http://synrc.com/apps/mad/doc/images}
-\begin{document}
-\title{MAD Bundles}
-\author{Maxim Sokhatsky}
-%HEVEA \begin{divstyle}{nonselectedwrapper}
-%HEVEA \begin{divstyle}{article}
-\input{toc}
-%HEVEA \begin{divstyle}{articlecol}
-\include{../bundles}
-%HEVEA \rawhtmlinput{templates/disqus.htx}
-%HEVEA \end{divstyle}
-%HEVEA \end{divstyle}
-%HEVEA \end{divstyle}
-%HEVEA \begin{divstyle}{clear}{~}\end{divstyle}
-\end{document}

+ 0 - 17
doc/web/commands.tex

@@ -1,17 +0,0 @@
-\input{../../../../synrc.hva}
-%HEVEA \loadcssfile{../../../../synrc.css}
-\renewcommand{\images}{http://synrc.com/apps/mad/doc/images}
-\begin{document}
-\title{MAD Commands}
-\author{Maxim Sokhatsky}
-%HEVEA \begin{divstyle}{nonselectedwrapper}
-%HEVEA \begin{divstyle}{article}
-\input{toc}
-%HEVEA \begin{divstyle}{articlecol}
-\include{../commands}
-%HEVEA \rawhtmlinput{templates/disqus.htx}
-%HEVEA \end{divstyle}
-%HEVEA \end{divstyle}
-%HEVEA \end{divstyle}
-%HEVEA \begin{divstyle}{clear}{~}\end{divstyle}
-\end{document}

+ 0 - 17
doc/web/config.tex

@@ -1,17 +0,0 @@
-\input{../../../../synrc.hva}
-%HEVEA \loadcssfile{../../../../synrc.css}
-\renewcommand{\images}{http://synrc.com/apps/mad/doc/images}
-\begin{document}
-\title{MAD Config}
-\author{Maxim Sokhatsky}
-%HEVEA \begin{divstyle}{nonselectedwrapper}
-%HEVEA \begin{divstyle}{article}
-\input{toc}
-%HEVEA \begin{divstyle}{articlecol}
-\include{../config}
-%HEVEA \rawhtmlinput{templates/disqus.htx}
-%HEVEA \end{divstyle}
-%HEVEA \end{divstyle}
-%HEVEA \end{divstyle}
-%HEVEA \begin{divstyle}{clear}{~}\end{divstyle}
-\end{document}

+ 0 - 17
doc/web/deps.tex

@@ -1,17 +0,0 @@
-\input{../../../../synrc.hva}
-%HEVEA \loadcssfile{../../../../synrc.css}
-\renewcommand{\images}{http://synrc.com/apps/mad/doc/images}
-\begin{document}
-\title{MAD Deps}
-\author{Maxim Sokhatsky}
-%HEVEA \begin{divstyle}{nonselectedwrapper}
-%HEVEA \begin{divstyle}{article}
-\input{toc}
-%HEVEA \begin{divstyle}{articlecol}
-\include{../deps}
-%HEVEA \rawhtmlinput{templates/disqus.htx}
-%HEVEA \end{divstyle}
-%HEVEA \end{divstyle}
-%HEVEA \end{divstyle}
-%HEVEA \begin{divstyle}{clear}{~}\end{divstyle}
-\end{document}

+ 0 - 18
doc/web/index.tex

@@ -1,18 +0,0 @@
-\input{../../../../synrc.hva}
-%HEVEA \loadcssfile{../../../../synrc.css}
-\renewcommand{\images}{http://synrc.com/apps/mad/doc/images}
-\begin{document}
-\title{MAD}
-\author{Maxim Sokhatsky}
-%HEVEA \begin{divstyle}{nonselectedwrapper}
-%HEVEA \begin{divstyle}{article}
-\input{toc}
-%HEVEA \begin{divstyle}{articlecol}
-\include{../index}
-%HEVEA \rawhtmlinput{templates/mad-comments.htx}
-%HEVEA \rawhtmlinput{templates/disqus.htx}
-%HEVEA \end{divstyle}
-%HEVEA \end{divstyle}
-%HEVEA \end{divstyle}
-%HEVEA \begin{divstyle}{clear}{~}\end{divstyle}
-\end{document}

+ 0 - 17
doc/web/ports.tex

@@ -1,17 +0,0 @@
-\input{../../../../synrc.hva}
-%HEVEA \loadcssfile{../../../../synrc.css}
-\renewcommand{\images}{http://synrc.com/apps/mad/doc/images}
-\begin{document}
-\title{MAD Ports}
-\author{Maxim Sokhatsky}
-%HEVEA \begin{divstyle}{nonselectedwrapper}
-%HEVEA \begin{divstyle}{article}
-\input{toc}
-%HEVEA \begin{divstyle}{articlecol}
-\include{../ports}
-%HEVEA \rawhtmlinput{templates/disqus.htx}
-%HEVEA \end{divstyle}
-%HEVEA \end{divstyle}
-%HEVEA \end{divstyle}
-%HEVEA \begin{divstyle}{clear}{~}\end{divstyle}
-\end{document}

+ 0 - 17
doc/web/scripts.tex

@@ -1,17 +0,0 @@
-\input{../../../../synrc.hva}
-%HEVEA \loadcssfile{../../../../synrc.css}
-\renewcommand{\images}{http://synrc.com/apps/mad/doc/images}
-\begin{document}
-\title{MAD Scripts}
-\author{Maxim Sokhatsky}
-%HEVEA \begin{divstyle}{nonselectedwrapper}
-%HEVEA \begin{divstyle}{article}
-\input{toc}
-%HEVEA \begin{divstyle}{articlecol}
-\include{../scripts}
-%HEVEA \rawhtmlinput{templates/disqus.htx}
-%HEVEA \end{divstyle}
-%HEVEA \end{divstyle}
-%HEVEA \end{divstyle}
-%HEVEA \begin{divstyle}{clear}{~}\end{divstyle}
-\end{document}

+ 0 - 17
doc/web/setup.tex

@@ -1,17 +0,0 @@
-\input{../../../../synrc.hva}
-%HEVEA \loadcssfile{../../../../synrc.css}
-\renewcommand{\images}{http://synrc.com/apps/mad/doc/images}
-\begin{document}
-\title{MAD Setup}
-\author{Maxim Sokhatsky}
-%HEVEA \begin{divstyle}{nonselectedwrapper}
-%HEVEA \begin{divstyle}{article}
-\input{toc}
-%HEVEA \begin{divstyle}{articlecol}
-\include{../setup}
-%HEVEA \rawhtmlinput{templates/disqus.htx}
-%HEVEA \end{divstyle}
-%HEVEA \end{divstyle}
-%HEVEA \end{divstyle}
-%HEVEA \begin{divstyle}{clear}{~}\end{divstyle}
-\end{document}

+ 0 - 11
doc/web/toc.tex

@@ -1,11 +0,0 @@
-%HEVEA \begin{divstyle}{toc}
-\section*{TOC}
-\paragraph{}
-\footahref{http://synrc.com/apps/mad/doc/web}{Overview} \@br
-\footahref{http://synrc.com/apps/mad/doc/web/setup.htm}{1. Setup} \@br
-\footahref{http://synrc.com/apps/mad/doc/web/deps.htm}{2. Deps} \@br
-\footahref{http://synrc.com/apps/mad/doc/web/config.htm}{3. Configuration} \@br
-\footahref{http://synrc.com/apps/mad/doc/web/commands.htm}{4. Commands} \@br
-\footahref{http://synrc.com/apps/mad/doc/web/bundles.htm}{5. Bundles} \@br
-\footahref{http://synrc.com/apps/mad/doc/book.pdf}{Download PDF} \@br
-%HEVEA \end{divstyle}

+ 0 - 190
index.html

@@ -1,190 +0,0 @@
-<!DOCTYPE html>
-<html >
-<head>
-
-  <link rel=stylesheet type="text/css" href="https://synrc.com/synrc.css?v=1">
-  <meta name="Author" content="5HT">
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-  <meta property="og:image" content="images/s_64.png"/>
-  <meta http-equiv="X-UA-Compatible" content="IE=IE10,chrome=1" />
-  <title>MAD</title>
-</head>
-<body >
-<!--HEVEA command line is: hevea index.tex -o index.htm -->
-<!--CUT STYLE article--><!--HTMLHEAD-->
-
-<div class="nonselectedwrapper white" style="padding: 10px 0px 10px 0px;margin: 0px 0px 10px 0px;">
-    <a href="//synrc.com/">
-    <img style="float:left; margin-left: 55px; margin-top: 5px; margin-bottom:-5px;" src="http://synrc.com/images/synrc.png" border="0"></a>
-
-    <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top" style="display:none;margin-top:39px;">
-      <input type="hidden" name="cmd" value="_s-xclick">
-      <input type="hidden" name="hosted_button_id" value="P8WQHAQK5HWWW">
-      <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" style="width:74px;margin-top:0px;">
-     </form>
-
-    <div align=right style="float:right;width:700px;height: auto; margin: 20px 50px 0px 0px;">
-          <script type="text/javascript">
-
-        var args = (window.location).toString().split('/');
-        var page_name = args[args.length-1];
-        var menu = {'https://synrc.com/index.htm':    'Home',
-                    'https://synrc.com/research.htm': 'Showcase',
-                    'https://synrc.com/apps/':   'Apps',
-                    'https://synrc.com/feedback.htm': 'Contacts', };
-
-        Object.keys(menu).forEach(function (key) {
-            if (page_name == key) { document.write('<div class="menu" style="font-weight: bold;">'+menu[key]+'</div>'); }
-            else { document.write('<a class="menu" href="'+key+'">'+menu[key]+'</a>'); }
-        });
-
-        </script>
-    </div>
-</div>
-
-<hr size="1">
-
-<!--ENDHTML-->
-<!--CUT DEF section 1 --><div class="nonselectedwrapper">
-<div class="article">
-<div class="toc">
-<!--TOC section id="sec1" TOC-->
-<h2 id="sec1" class="section">TOC</h2><!--SEC END -->
-<!--TOC paragraph id="sec2" -->
-<!--SEC END --><p>
-<a href="https://synrc.com/apps/mad/doc/web">Overview</a> <br>
-
-<a href="https://synrc.com/apps/mad/doc/web/setup.htm">1. Setup</a> <br>
-
-<a href="https://synrc.com/apps/mad/doc/web/deps.htm">2. Deps</a> <br>
-
-<a href="https://synrc.com/apps/mad/doc/web/config.htm">3. Configuration</a> <br>
-
-<a href="https://synrc.com/apps/mad/doc/web/commands.htm">4. Commands</a> <br>
-
-<a href="https://synrc.com/apps/mad/doc/web/bundles.htm">5. Bundles</a> <br>
-
-<a href="https://synrc.com/apps/mad/doc/book.pdf">Download PDF</a> <br>
-
-</p></div>
-
-<div class="articlecol">
-
-<!--TOC section id="sec3" MAD: Erlang Containers-->
-<h2 id="sec3" class="section">MAD: Erlang Containers</h2><!--SEC END -->
-<!--TOC subsection id="sec4" Purpose-->
-<h3 id="sec4" class="subsection">Purpose</h3><!--SEC END --><p>
-We were trying to make something minimalistic that fits out <a href="https://github.com/synrc">application stack</a>.
-The main idea of mad is to provide clean and simple rebar-like fast dependency manager that
-is able to build several types of packages and provides interface of containered deployments
-to virtualiezed environments.</p>
-<!--TOC subsection id="sec5" Several Types of Packaging-->
-<h3 id="sec5" class="subsection">Several Types of Packaging</h3><!--SEC END --><p>
-The key feature of mad is ability to create single-file bundled web sites.
-This target escript is ready to run on Windows, Linux and Mac.</p>
-<!--TOC subsection id="sec6" Deployment Options-->
-<h3 id="sec6" class="subsection">Deployment Options</h3><!--SEC END --><p>
-As a deploy tool mad is also supposed to launch, start, stop and manage containers, locally or remote.
-You can make containers from different type of packages, like making runc container with beam release.</p>
-<!--TOC subsection id="sec7" OTP Compliant-->
-<h3 id="sec7" class="subsection">OTP Compliant</h3><!--SEC END --><p>
-Mad supports ERTS boot files generation with systools and erlang application format used by OTP.
-This is the main format of application repository. Also boot files are suported on both LING and BEAM.</p>
-<!--TOC subsection id="sec8" Tiny Size-->
-<h3 id="sec8" class="subsection">Tiny Size</h3><!--SEC END --><p>
-And the good part:</p><div class="lstlisting">                      Sources        Binary
-    mad               967 LOC        52 KB
-    rebar             7717 LOC       181 KB</div>
-<!--TOC subsection id="sec9" History-->
-<h3 id="sec9" class="subsection">History</h3><!--SEC END --><p>We came to conclusion that no matter how perfect your libraries are,
-the comfort and ease come mostly from developing tools.
-Everything got started when <a href="https://github.com/proger">Vladimir Kirillov</a> decided to
-replace Rusty’s sync beam reloader. As you know sync uses
-filesystem polling which is neither energy-efficient nor elegant. Also
-sync is only able to recompile separate modules while
-common use-case in N2O is to recompile DTL templates
-and LESS/SCSS stylesheets. That is why we need to recompile
-the whole project. That’s the story how <a href="https://github.com/synrc/active">active</a> emerged.
-Under the hood active is a client subscriber
-of <a href="https://github.com/synrc/fs">fs</a> library, native filesystem listener for Linux, Windows and Mac.</p><p>De-facto standard in Erlang world is rebar.
-We love rebar interface despite its implementation.
-First we plugged rebar into active and then decided to drop its support,
-it was slow, especially in cold recompilation.
-It was designed to be a stand-alone tool, so it has some
-glitches while using as embedded library.
-Later we switched to Makefile-based build tool <a href="https://github.com/synrc/otp.mk">otp.mk</a>.</p><p>The idea to build rebar replacement was up in the air for a long time.
-The best minimal approach was picked up by <a href="https://github.com/s1n4">Sina Samavati</a>,
-who implemented the first prototype called ’mad’. Initially mad
-was able to compile DTL templates, YECC files, escript (like
-bundled in gproc), also it had support for caching with side-effects.
-In a month I forked mad and took over the development under the same name.</p><div class="center">Listing 1: Example of building N2O sample</div><p><br>
-</p><div class="lstlisting">                                   Cold       Hot
-    rebar get-deps compile         53.156s    4.714s
-    mad deps compile               54.097s    0.899s</div><div class="center">Listing 2: Example of building Cowboy</div><p><br>
-</p><div class="lstlisting">                                   Hot
-    make (erlang.mk)               2.588s
-    mad compile                    2.521s</div><p>
-
-<br><br>
-<h2><a name="testimonials"><b>About MAD</b></a></h2><blockquote>At the beginning, Mad was supposed to be only a Rebar-compatible dependency manager, after a while,
-I realized compiling applications as fast as possible with it could be a fascinating work as well.
-<div align=right>Sina Samavati,
-<a href="https://github.com/s1n4">Original MAD Author</a></div></blockquote>
-
-
-
-    <!--div id="disqus_thread"></div>
-    <script type="text/javascript">
-        var disqus_shortname = 'synrc'; // required: replace example with your forum shortname
-        (function() {
-            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
-            dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
-            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
-        })();
-    </script>
-    <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
-    <a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a-->
-
-
-</p></div>
-</div>
-</div><div class="clear"> </div><!--CUT END -->
-<!--HTMLFOOT-->
-
-<div class="nonselectedwrapper">
-<div class="verywidecol">
-
-    <div style="width:100%;height:300px;float:left;font-size:16pt;" align=center>
-    	<hr size=1>
-    	<br><br><br>
-        <a href="//synrc.com/news/index.htm">Events</a> |
-    	<a href="//synrc.com/privacy.htm">Privacy Policy</a> |
-        <a href="//synrc.com/feedback.htm">Feedback</a> |
-        <a href="//synrc.com/brandbook.htm">Brandbook</a><br>
-    	Copyright &copy; 2005&ndash;2016 <a href="//synrc.com/index.htm"> Synrc Research Center s.r.o.</a>
-    </div>
-
-</div>
-</div>
-
-
-<div class="clear"></div>
-
-<script type="text/javascript">
-
-  var _gaq = _gaq || [];
-    _gaq.push(['_setAccount', 'UA-29227518-1']);
-      _gaq.push(['_trackPageview']);
-      
-        (function() {
-            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
-                ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'https://www') + '.google-analytics.com/ga.js';
-                    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
-                      })();
-                      
-                      </script>
-
-<script type="text/javascript" src="https://synrc.com/hi.js"></script>
-<!--ENDHTML-->
-</body>
-</html>