Permalink
Browse files

more w3c compliance

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@791 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
1 parent a35bad5 commit e35a59185374eeb06d3221d9070269bc046a8810 @klacke committed Dec 9, 2004
Showing with 356 additions and 315 deletions.
  1. +23 −22 www/arg.yaws
  2. +54 −49 www/bindings.yaws
  3. +31 −31 www/cookies.yaws
  4. +78 −62 www/embed.yaws
  5. +45 −39 www/form.yaws
  6. +25 −20 www/pcookie.yaws
  7. +41 −39 www/query.yaws
  8. +4 −4 www/readpcookie.yaws
  9. +39 −34 www/redirect.yaws
  10. +7 −3 www/session.yaws
  11. +3 −6 www/ssi.yaws
  12. +4 −4 www/upload.yaws
  13. +2 −2 www/upload0.yaws
View
@@ -10,18 +10,18 @@ out(A) ->
<h2> The Arg </h2>
-<p>This page displays the Arg #arg structure
-supplied to the out/1 function.
-
-<p> The #arg structure is a very important datastructure for the
-yaws programmer. It is the main mechanism whereby the server can pass
-data to the web application. There are several data items
-which are of interest to the webapplication, such as which headers
-were sent from the client, etc.
-The #arg recored is defined in <tt>yaws_api.hrl</tt> and is defined as:
-
-<div class="box">
-<pre>
+ <p>This page displays the Arg #arg structure
+ supplied to the out/1 function.
+ </p>
+ <p> The #arg structure is a very important datastructure for the
+ yaws programmer. It is the main mechanism whereby the server can pass
+ data to the web application. There are several data items
+ which are of interest to the webapplication, such as which headers
+ were sent from the client, etc.
+ The #arg recored is defined in <tt>yaws_api.hrl</tt> and is defined as:
+ </p>
+ <div class="box">
+ <pre>
-record(arg, {
@@ -38,22 +38,23 @@ The #arg recored is defined in <tt>yaws_api.hrl</tt> and is defined as:
state, %% State for use by users of the out/1 callback
pid, %% pid of the yaws worker process
opaque, %% useful to pass static data
- appmod_prepath, %% path in front of: <appmod><appmoddata>
-
+ appmod_prepath, %% path in front of: &lt;appmod&gt;&lt;appmoddata&gt;
pathinfo %% Set to 'd/e' when calling c.yaws for the request
%% http://some.host/a/b/c.yaws/d/e
}).
-</pre>
-</div>
-
-<p> As we have seen is several previous examples, the <tt> out/1</tt> function
-defined in .yaws files, gets invoked with a single argument which is
-a #arg{} record, fitting the specific HTTP request being served.
+ </pre>
+ </div>
-<p> The code to display the #arg{} record
-is in defined in file <a href="code.yaws?file=/arg.yaws">arg.yaws</a>
+ <p> As we have seen is several previous examples,
+ the <tt> out/1</tt> function
+ defined in .yaws files, gets invoked with a single argument which is
+ a #arg{} record, fitting the specific HTTP request being served.
+ </p>
+ <p> The code to display the #arg{} record
+ is in defined in file <a href="code.yaws?file=/arg.yaws">arg.yaws</a>
+ </p>
<erl>
View
@@ -6,38 +6,42 @@ out(A) ->
<div id="entry">
<h2> Bindings </h2>
-<p>
-Bindings are the opposite of <a href="ssi.yaws"> Server Side Includes (SSI)</a>.
-SSI is used when entire pages are written largely in EHTML and
-snippets of HTML, or more typically javascript code is inserted into the EHTML
-code.
-
-<p> Bindings are used the other way around. Essentially entire
-pages are written in regular HTML but parts of the HTML needs to be
-dynamically generated.
-
-<p>The yaws callback out/1 can return
-
-<div class="box">
-<pre>
-{bindings, [{Key1, Value2}, {Key2, Value2} .....]}.
-</pre>
-</div>
-
-
-<p>All bindings can then be used in the rest of yaws code (in HTML source and
-within erl tags). In HTML source %%Key%% is expanded to Value and
-within erl tags yaws_api:get_binding(Key) can be used to extract Value.
-
-<p>With the binding feature it is easier to write transparent yaws code making
-it easier to to work together with Web people knowing little or
-nothing about Erlang.
-
-An example:
-
-
-<div class="box">
-<pre>
+ <p>
+ Bindings are the opposite of
+ <a href="ssi.yaws"> Server Side Includes (SSI)</a>.
+ SSI is used when entire pages are written largely in EHTML and
+ snippets of HTML, or more typically javascript code is
+ inserted into the EHTML
+ code.
+ </p>
+
+ <p> Bindings are used the other way around. Essentially entire
+ pages are written in regular HTML but parts of the HTML needs to be
+ dynamically generated.
+ </p>
+ <p>The yaws callback out/1 can return
+ </p>
+ <div class="box">
+ <pre>
+ {bindings, [{Key1, Value2}, {Key2, Value2} .....]}.
+ </pre>
+ </div>
+
+
+ <p>All bindings can then be used in the rest of yaws code (in HTML source and
+ within erl tags). In HTML source %%Key%% is expanded to Value and
+ within erl tags yaws_api:get_binding(Key) can be used to extract Value.</p>
+
+ <p>With the binding feature it is easier to write transparent yaws code making
+ it easier to to work together with Web people knowing little or
+ nothing about Erlang.</p>
+
+ <p>
+ An example:
+ </p>
+
+ <div class="box">
+ <pre>
&lt;erl&gt;
out(A) -&gt; {bindings, [{"A", "foo"}, {"B", "baz"}]}.
@@ -62,15 +66,15 @@ out(A) -&gt;
%%A%% = %%A%% (hit me)
&lt;/body&gt;
&lt;/html&gt;
-</pre>
-</div>
+ </pre>
+ </div>
<p>
-Which expands to:
+ Which expands to:</p>
-<div class="box">
-<pre>
+ <div class="box">
+ <pre>
@@ -88,23 +92,24 @@ foo = foo (hit me)
-</pre>
-</div>
+ </pre>
+ </div>
-<p> And is rendered as:
+ <p> And is rendered as:</p>
-<div class="box">
-<p>foo</p>
-<p><font size="4">foo != baz</font></p>
-<p>An enormous amount of plain html source here.</p>
+ <div class="box">
+ <p>foo</p>
+ <p><font size="4">foo != baz</font></p>
+ <p>An enormous amount of plain html source here.</p>
-<ul>
-<li>foo</li>
-<li>gazonk</li></ul>
+ <ul>
+ <li>foo</li>
+ <li>gazonk</li>
+ </ul>
-foo = foo (hit me)
-</div>
+ foo = foo (hit me)
+ </div>
View
@@ -7,37 +7,37 @@ out(A) ->
-<h1>Yaws and Cookies</h1>
-<p>
-Cookies are the means in HTTP to assign data to a session. A HTTP session
-typically consists of many (and sometimes concurrent) TCP connections from the
-client to the web server. The first time a client arrives to our webserver, we
-issue the HTTP header <tt>Set-Cookie: var=someval</tt>. The browser will then in
-subsequent connections to the same server pass this cookie "var=someval" in its
-client side <tt>Cookie: var=someval</tt> header. We can thereby assign state to a
-session, either through data actualy encoded into the cookie value itself, or by
-associating server side session data to the cookie.
-<p>
-
-Let's do an example where we set a simple cookie, and create a specific erlang process
-which is then responsible for that session.
-The cookie value will be a string encoding of the pid handling the session.
-
-<p>
-The yaws code in
-<a href="setcookie.yaws">setcookie.yaws</a> sets the cookie in the browser.
-
-<p>And the yaws code in <a href="readcookie.yaws">readcookie.yaws</a>
-will read the cookie
-and report some uninteresting session data.
-
-
-
-A correct definition of cookies can be found at Netscapes
-<a href="http://www.netscape.com/newsref/std/cookie_spec.html">cookie spec</a>
-
-
-<p>The code to set the cookie looks like:
+ <h1>Yaws and Cookies</h1>
+ <p>
+ Cookies are the means in HTTP to assign data to a session. A HTTP session
+ typically consists of many (and sometimes concurrent) TCP connections from the
+ client to the web server. The first time a client arrives to our webserver, we
+ issue the HTTP header <tt>Set-Cookie: var=someval</tt>. The browser will then in
+ subsequent connections to the same server pass this cookie "var=someval" in its
+ client side <tt>Cookie: var=someval</tt> header. We can thereby assign state to a
+ session, either through data actualy encoded into the cookie value itself, or by
+ associating server side session data to the cookie.</p>
+ <p>
+
+ Let's do an example where we set a simple cookie, and create a specific erlang process
+ which is then responsible for that session.
+ The cookie value will be a string encoding of the pid handling the session.
+ </p>
+ <p>
+ The yaws code in
+ <a href="setcookie.yaws">setcookie.yaws</a> sets the cookie in the browser.</p>
+
+ <p>And the yaws code in <a href="readcookie.yaws">readcookie.yaws</a>
+ will read the cookie
+ and report some uninteresting session data.
+ </p>
+
+ <p>
+ A correct definition of cookies can be found at Netscapes
+ <a href="http://www.netscape.com/newsref/std/cookie_spec.html">cookie spec</a></p>
+
+
+ <p>The code to set the cookie looks like:</p>
<erl>
out(A) ->
Oops, something went wrong.

0 comments on commit e35a591

Please sign in to comment.