Namdak Tonpa 6 years ago
parent
commit
dfe14b46c8

+ 1 - 1
include/mad.hrl

@@ -1 +1 @@
--define(VERSION,"a31d04").
+-define(VERSION,"64c9f0").

BIN
mad


+ 2 - 1
man/mad.htm

@@ -14,7 +14,8 @@
 
 
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>MAD</a>
+    <a href='https://mad,n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">MAD</a>
 </nav>
 </nav>
 
 
 <header>
 <header>

+ 2 - 1
man/mad_app.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>APP</a>
+    <a href='https://mad.n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">APP</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 2 - 1
man/mad_compile.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>COMPILE</a>
+    <a href='https://mad.n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">COMPILE</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 2 - 1
man/mad_cubical.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>CUBICAL</a>
+    <a href='https://mad.n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">CUBICAL</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 2 - 1
man/mad_dtl.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>DTL</a>
+    <a href='https://mad.n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">DTL</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 2 - 1
man/mad_erl.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>ERL</a>
+    <a href='https://mad.n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">ERL</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 2 - 1
man/mad_escript.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>ESCRIPT</a>
+    <a href='https://mad.n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">ESCRIPT</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 2 - 1
man/mad_eunit.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>EUNIT</a>
+    <a href='https://mad.n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">EUNIT</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 2 - 1
man/mad_git.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>GIT</a>
+    <a href='https://mad.n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">GIT</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 2 - 1
man/mad_hooks.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>HOOKS</a>
+    <a href='https://mad.n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">HOOKS</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 2 - 1
man/mad_leex.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>LEEX</a>
+    <a href='https://mad.n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">LEEX</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 2 - 1
man/mad_local.htm

@@ -14,7 +14,8 @@
 
 
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>MAD</a>
+    <a href='https://mad,n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">LOCAL</a>
 </nav>
 </nav>
 
 
 <header>
 <header>

+ 2 - 1
man/mad_man.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>MAN</a>
+    <a href='https://mad.n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">MAN</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 2 - 1
man/mad_none.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>NONE</a>
+    <a href='https://mad.n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">NONE</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 2 - 1
man/mad_peg.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>PEG</a>
+    <a href='https://mad.n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">PEG</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 2 - 1
man/mad_port.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>PORT</a>
+    <a href='https://mad.n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">PORT</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 2 - 1
man/mad_release.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>RELEASE</a>
+    <a href='https://mad.n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">RELEASE</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 2 - 1
man/mad_repl.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>REPL</a>
+    <a href='https://mad.n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">REPL</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 2 - 1
man/mad_run.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>RUN</a>
+    <a href='https://mad.n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">RUN</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 2 - 1
man/mad_script.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>SCRIPT</a>
+    <a href='https://mad.n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">SCRIPT</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 2 - 1
man/mad_static.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>STATIC</a>
+    <a href='https://mad.n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">STATIC</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 2 - 1
man/mad_systools.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>SYSTOOLS</a>
+    <a href='https://mad.n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">SYSTOOLS</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 2 - 1
man/mad_utils.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>UTILS</a>
+    <a href='https://mad.n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">UTILS</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 2 - 1
man/mad_yecc.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>YECC</a>
+    <a href='https://mad.n2o.space'>MAD</a>
+    <a href='#' style="background:#ededed;">YECC</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 2 - 1
priv/man/module.htm

@@ -11,7 +11,8 @@
 <body>
 <body>
 <nav>
 <nav>
     <a href='https://n2o.space'>SPACE</a>
     <a href='https://n2o.space'>SPACE</a>
-    <a href='../index.html'>MAN_NAME</a>
+    <a href='https://MAN_CNAME'>MAN_TOOL</a>
+    <a href='#' style="background:#ededed;">MAN_NAME</a>
 </nav>
 </nav>
 <header>
 <header>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>
     <a href="../index.html"><img src="https://n2o.space/img/Synrc Neo.svg"></a>

+ 8 - 3
src/mad_man.erl

@@ -9,18 +9,23 @@ man(Params) ->
          ++ filelib:wildcard("src/**/*.erl") ],
          ++ filelib:wildcard("src/**/*.erl") ],
    false.
    false.
 
 
+write(Gen,Bin) -> io:format("Generated: ~p~n",[Gen]), file:write_file(Gen,Bin).
 replace(S,A,B) -> re:replace(S,A,B,[global,{return,list}]).
 replace(S,A,B) -> re:replace(S,A,B,[global,{return,list}]).
+trim(A) -> re:replace(A, "(^\\s+)|(\\s+$)", "", [global,{return,list}]).
 fix([Prefix]) -> Prefix;
 fix([Prefix]) -> Prefix;
 fix([Prefix,Name|Rest]) -> Name.
 fix([Prefix,Name|Rest]) -> Name.
 generate(Lower,Temp) ->
 generate(Lower,Temp) ->
     Name = string:to_upper(Lower),
     Name = string:to_upper(Lower),
-    Bin = iolist_to_binary(replace(Temp,"MAN_NAME",fix(string:tokens(Name,"_")))),
+    Tem2 = replace(Temp,"MAN_TOOL",hd(string:tokens(Name,"_"))),
+    CNAME = binary_to_list(element(2,file:read_file("CNAME"))),
+    Tem3 = replace(Tem2,"MAN_CNAME",trim(CNAME)),
+    Bin = iolist_to_binary(replace(Tem3,"MAN_NAME",fix(string:tokens(Name,"_")))),
     Gen = lists:concat(["man/",Lower,".htm"]),
     Gen = lists:concat(["man/",Lower,".htm"]),
     case file:read_file_info(Gen) of
     case file:read_file_info(Gen) of
-         {error,_} -> io:format("Generated: ~p~n",[Gen]), file:write_file(Gen, Bin);
+         {error,_} -> write(Gen, Bin);
          {ok,A} -> case element(2,A) > size(Bin) of
          {ok,A} -> case element(2,A) > size(Bin) of
                         true -> skip;
                         true -> skip;
-                        false -> warning end end.
+                        false -> write(Gen,Bin) end end.
 
 
 template() ->
 template() ->
     mad_repl:load(),
     mad_repl:load(),