Maxim Sokhatsky 10 years ago
parent
commit
76c17a9b70
5 changed files with 167 additions and 79 deletions
  1. 2 2
      doc/book.tex
  2. 10 10
      doc/deps.tex
  3. 1 59
      doc/index.tex
  4. 16 8
      doc/setup.tex
  5. 138 0
      doc/synrc.tex

+ 2 - 2
doc/book.tex

@@ -1,9 +1,9 @@
 % copyright (c) 2013 Synrc Research Center
 
-\documentclass[12pt,oneside]{article}
+\documentclass[8pt,twoside]{article}
 \input{synrc.tex}
 \begin{document}
-% \titleMAD
+\titleMAD
 \tableofcontents
 \include{index}
 \include{setup}

+ 10 - 10
doc/deps.tex

@@ -7,21 +7,21 @@ Specifically two kinds of directory layouts:
 
 \vspace{1\baselineskip}
 \begin{lstlisting}[caption=Solution]
-    ├── apps
-    ├── deps
-    ├── rebar.config
-    └── sys.config
+    +-- 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
+    +-- deps
+    +-- ebin
+    +-- include
+    +-- priv
+    +-- src
+    +-- rebar.config
 \end{lstlisting}
 \vspace{1\baselineskip}
 

+ 1 - 59
doc/index.tex

@@ -82,37 +82,6 @@ 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.
 
-\subsection{Templates}
-
-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 plan bundle web_app
-\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 web_app
-    Applications: [kernel,stdlib,crypto,cowlib,ranch,cowboy,compiler,syntax_tools,
-                   erlydtl,gproc,xmerl,n2o,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}
-
 \subsection{Deploy}
 
 mad is also supposed to be a deploy tool with ability to
@@ -124,26 +93,6 @@ also to Heroku and others.
 mad supports rebar umbrella project structure.
 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{Apps Ordering}
 
 As you may know you can create OTP releases with
@@ -151,14 +100,7 @@ reltool (rebar generate) or systools (relx). mad currently
 creates releases with relx but is going to do it independently soon.
 Now it can only order applications.
 
-\vspace{1\baselineskip}
-\begin{lstlisting}
-    # mad plan
-    Ordered: [kernel,stdlib,mnesia,kvs,crypto,cowlib,ranch,
-              cowboy,compiler,syntax_tools,erlydtl,gproc,
-              xmerl,n2o,n2o_sample,fs,active,mad,rest,sh]
-\end{lstlisting}
-\vspace{1\baselineskip}
+\subsection{Size}
 
 And the good part:
 

+ 16 - 8
doc/setup.tex

@@ -20,8 +20,9 @@ If you want you can compile mad by yourself:
 
 \vspace{1\baselineskip}
 \begin{lstlisting}
-    # git clone http://github.com/synrc/mad && cd mad
-    # make
+    # git clone http://github.com/synrc/mad \
+             && cd mad \
+             && make
 \end{lstlisting}
 \vspace{1\baselineskip}
 
@@ -40,18 +41,25 @@ just having a single copy of mad binary.
 \end{lstlisting}
 \vspace{1\baselineskip}
 
-After that you can just run escript web_app under Windows, Linux and
+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 web_app
-    Applications: [kernel,stdlib,crypto,cowlib,ranch,cowboy,compiler,syntax_tools,
-                   erlydtl,gproc,xmerl,n2o,n2o_sample,fs,active,mad,sh]
-    Configuration: [{n2o,[{port,8000},{route,routes}]},
+    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]
+                          {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>

+ 138 - 0
doc/synrc.tex

@@ -0,0 +1,138 @@
+% 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{hevea}
+\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}