Permalink
Browse files

ssi include with var expansion + docs

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@561 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
1 parent ad844e6 commit dbab7a343e8500e5998f7add9acbc04d9001a71f @klacke committed Dec 17, 2003
Showing with 478 additions and 739 deletions.
  1. +28 −0 include/yaws_api.hrl
  2. +2 −1 vsn.mk
  3. +100 −106 www/configuration.yaws
  4. +198 −210 www/dynamic.yaws
  5. +65 −414 www/index.yaws
  6. +3 −5 www/man.yaws
  7. +29 −1 www/query.yaws
  8. +2 −2 www/ssi.yaws
  9. +13 −0 www/ssi/dynamic.1
  10. +15 −0 www/ssi/dynamic.2
  11. +23 −0 www/ssi/dynamic.3
View
@@ -85,3 +85,31 @@
secure,
version}).
+
+%% Search a var, find it or crash
+
+-define(VAR(__ARG, __Key),
+ if (__ARG#arg.req)#http_request.method == 'GET' ->
+ {value,{_,__Val}}=lists:keysearch(__Key,1,yaws_api:parse_query(__ARG)), __Val;
+ (__ARG#arg.req)#http_request.method == 'POST' ->
+ {value,{_,__Val}}=lists:keysearch(__Key,1,yaws_api:parse_post_data(__ARG)), __Val
+ end).
+
+
+%% Search a var: return {ok, Val} | false
+-define(SVAR(__ARG, __Key),
+ if (__ARG#arg.req)#http_request.method == 'GET' ->
+ case lists:keysearch(__Key,1,yaws_api:parse_query(__ARG)) of
+ {value,{_,__Val}} -> {ok, __Val};
+ false -> false
+ end;
+ (__ARG#arg.req)#http_request.method == 'POST' ->
+ case lists:keysearch(__Key,1,yaws_api:parse_post_data(__ARG)) of
+ {value,{_,__Val}} ->
+ {ok, __Val};
+ false ->
+ false
+ end
+ end).
+
+
View
3 vsn.mk
@@ -1 +1,2 @@
-YAWS_VSN=1.32
+YAWS_VSN=1.40
+
View
@@ -1,118 +1,112 @@
<erl>
-out(A) ->
- yaws_api:ssi(A#arg.docroot, ["/HEAD", "/TOPTAB"]).
-
-
-</erl>
-
-
-<h2>Build and install</h2>
+box(Str) ->
+ {'div',[{class,"box"}],
+ {pre,[],Str}}.
-<p>
-Yaws is hosted by the excellent source code site SourceForge <a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=45637&type=1" width="88" height="31" border="0" alt="SourceForge.net Logo"></a>.
-The Yaws SourceForge www page is <a href="http://sourceforge.net/projects/erlyaws/">http://sourceforge.net/projects/erlyaws</a>
-
-<p>To cvs check out the latest source first install
-an <a href="http://www.erlang.org">Erlang</a> system, then do:
-
-
-<erl>
-out(A) -> yaws_api:pre_ssi_string("
+out(A) ->
+ [{ssi, "HEAD", [],[]},
+ {ssi, "TOPTAB", [],[]},
+ {ehtml,
+ [{h2,[],"Build and install"},
+ {p,[], ["Yaws is hosted by the excellent source code site SourceForge ",
+ {a ,[{href,"http://sourceforge.net"}],
+ {img, [{src,"http://sourceforge.net/sflogo.php?group_id=45637&type=1"},
+ {width,"88"},
+ {height,"31"},
+ {border,"0"},
+ {alt,"SourceForge.net Logo"}]}},
+ "The Yaws SourceForge www page is ",
+ {a ,[{href,"http://sourceforge.net/projects/erlyaws/"}],
+ "http://sourceforge.net/projects/erlyaws"}
+ ]},
+ {p,[], ["To cvs check out the latest source first install an ",
+ {a, [{href,"http://www.erlang.org"}],"Erlang"},
+ " system, then do: "]},
+ box("
# export CVS_RSH=ssh
# export CVSROOT=:pserver:anonymous@cvs.erlyaws.sourceforge.net:/cvsroot/erlyaws
# cvs login
# cvs -z3 co .
# cd yaws; make; make install
-").
-
-</erl>
-
-<p>
-The above commands will
-checkout the bleeding edge source, build it and install it at
-127.0.0.1:80 with the docroot set to the local documentation.
-
-<p>Give return as password.
-
-<p>Run ./configure
-
-<p><tt>make</tt> (without install)
-will build the yaws system and
-
-<tt>make local_install</tt>
-does a local
-install at http://127.0.0.1:8000. This is the typical mode of operation
-while either just trying out yaws, or hacking yaws. This will install
-a template configuration file <tt>yaws.conf</tt> in $HOME.
-If $HOME/yaws.conf exists, the old file will not be overwritten.
-<p>A yaws executable (shell script) will be written into
-the $HOME/bin directory.
-
-<p>To run a locally installed system, we run the yaws script found in the
-bin directory in the source code tree or $HOME/bin/yaws
-
-<p>
-<tt> make install</tt> will also build the yaws system and also
-install it in /usr/local. A configuration file /etc/yaws.conf will
-also be installed unless the file already exists. The default config
-file will set up the system to listen on http://127.0.0.1:80
-
+"),
+
+ {p,[], "The above commands will "
+ "checkout the bleeding edge source, build it and install it at "
+ "127.0.0.1:80 with the docroot set to the local documentation"},
+ {p,[], "Give return as password."},
+ {p,[], "Run ./configure"},
+
+ {p, [], [{tt, [], "make"} ,
+ "(without install) will build the yaws system and ",
+ {tt, [], "make local_install"},
+ "does a local install at http://127.0.0.1:8000. This is the typical mode of operation"
+ " while either just trying out yaws, or hacking yaws. This will install "
+ " a template configuration file yaws.conf in $HOME. "
+ "If $HOME/yaws.conf exists, the old file will not be overwritten. "]},
+
+ {p,[],"A yaws executable (shell script) will be written into "
+ "the $HOME/bin directory."},
+
+ {p,[], "To run a locally installed system, we run the yaws script found in the "
+ " bin directory in the source code tree or $HOME/bin/yaws "},
+
+ {p,[],[
+ {tt,[], "make install"},
+ " will also build the yaws system and also "
+ "install it in /usr/local. A configuration file /etc/yaws.conf will "
+ " also be installed unless the file already exists. The default config "
+ " file will set up the system to listen on http://127.0.0.1:80 "]},
+
+ {h2,[], "Running yaws"},
+ {p,[], ["The yaws executable is a shell script which invokes the "
+ "erlang system and instructs it to start yaws. "
+ " The command line flags for yaws are documented in ",
+ {a,[{href, "man.yaws?page=yaws"}],
+ ["man page for ",
+ {tt, [], "yaws (1)"}]}]},
+
+
+ {p,[], "When developing yaws code, the interactive mode is ideal. Typically "
+ "yaws is then started as: "},
+ {br},
+ box("yaws -i"),
+
+
+ {p, [], "Run yaws as a daemon as"},
+ box("yaws -D"),
+
+ {p,[], "All command line flags to yaws are described in the "
+ "man page for yaws. "},
+
+ {h2,[], "Configuring Yaws"},
+
+ {p,[],["Web server configuration can be supplied to yaws "
+ "in either of two ways depending ",
+ "on whether we run yaws as a standalone daemon or if we run yaws as an "
+ " embedded application inside another Erlang program. "]},
+ {p,[],["The yaws configuration is described in ",
+ {a, [{href,"man.yaws?page=yaws.conf"}],
+ ["man page for ",
+ {tt,[], "yaws.conf (5)"}]}]},
+
+ {h3, [], "Embedded mode"},
+
+ {p,[], ["It is possible to run yaws in embedded mode where yaws is part of a "
+ "larger application. When running yaws in embedded mode, it is often not "
+" possible to let yaws read its configuration data from /etc/yaws.conf."]},
+
+ {p,[], ["The function ",
+ {tt, [], "yaws_api:setconf(Gconf, Groups)"},
+ "can be used by an other erlang process to explicitly set a yaws configuration at runtime.."
+ "To execute Yaws in embedded mode, it must be started with the environment ",
+ {tt, [], "{embedded, true}"},
+ "The embedded mode is fully described at ",
+ {a, [{url, "embed.yaws"}], "embed.yaws"}]}
+ ]},
+ {ssi, "END",[],[]}
+ ].
-<h2>Running yaws </h2>
-<p>The yaws executable is a shell script which invokes the
-erlang system and instructs it to start yaws.
-The command line flags for yaws are documented in
-<a href="man.yaws?page=yaws"> man page for <tt>yaws (1)</tt> </a>
-
-<p>When developing yaws code, the interactive mode is ideal. Typically
-yaws is then started as:
-<br>
-<pre>
-# yaws -i
-</pre>
-
-
-<p>Run yaws as a daemon as
-
-<pre>
-# yaws -D
-</pre>
-
-All command line flags to yaws are described in the
-man page for yaws.
-
-
-<H2>Configuring Yaws</h2>
-
-<p>
-Web server configuration can be supplied to yaws
-in either of two ways depending
-on wheter we run yaws as a standalone daemon or if we run yaws as an
-embedded application inside another Erlang program.
-
-
-<p>
-The yaws configuration is described in
-<a href="man.yaws?page=yaws.conf"> man page for <tt>yaws.conf (5)</tt> </a>
-
-
-
-<h3>Embedded mode</h3>
-
-<p>
-It is possible to run yaws in embedded mode where yaws is part of a
-larger application. When running yaws in embedded mode, it is often not
-possible to let yaws read its configuration data from /etc/yaws.conf.
-<p>The function <tt>yaws_api:setconf(Gconf, Groups)</tt> can be used by an
-other erlang process to explicitly set a yaws configuration at runtime.
-
-<p>Yaws must be started with the environment <tt>{embedded, true}\<tt>
-
-
-
-<erl>
-out(A) -> yaws_api:ssi(A#arg.docroot, ["/END"]).
</erl>
Oops, something went wrong.

0 comments on commit dbab7a3

Please sign in to comment.