Skip to content

Commit

Permalink
Deploying to gh-pages from @ fa8015e 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
balat committed Dec 21, 2023
1 parent ba0427c commit d114f6a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions 7.1/manual/basics.html
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
This greatly simplifies communication between server and client.
</p><p>Pages can be generated either on the server or the client.
The first HTTP request usually returns a server-side generated HTML page
(thus indexable by search engines), but subsequent page generations are done
(thus indexable by search engines), but subsequent page generations can be done
by the client for better performance.
In a mobile app, all pages are usually generated on the client.
</p><p>One of the key features of Eliom is that it allows
Expand All @@ -370,7 +370,7 @@
</p><p class="centered"><img src="files/tutorial/client-server.svg" alt="Client-server build system" class="img-col-width-400"/>
</p><h3>Client values</h3><p>Fragments of client code can be included in server (or shared) sections.
</p><p>Example:
</p><pre class="server" class=""><code class="language-ocaml translatable">button ~a:[a_onclick [%client fun ev -&gt; ... ]] [ ... ]</code></pre><p>The syntax is <span class="teletype">[%client (&lt;value&gt; : &lt;type&gt;) </span>.
</p><pre class="server" class=""><code class="language-ocaml translatable">button ~a:[a_onclick [%client fun ev -&gt; ... ]] [ ... ]</code></pre><p>The syntax is <span class="teletype">[%client (&lt;value&gt; : &lt;type&gt;)]</span>.
Type annotation is almost always required.
</p><p>These client fragments can be manipulated as server side OCaml values:
</p><pre class="server" class=""><code class="language-ocaml translatable">let%server x : int Eliom_client_value.t = [%client 1 + 3 ]</code></pre><p>If such section is reached while generating a page on server side,
Expand All @@ -379,7 +379,7 @@
the client-side code will be executed immediately
(In that case, you can delay the execution, if needed,
for example with function
<span><a href=".././../../ocsigen-toolkit/latest/api/client/Ot_nodeready#VALnodeready">Ot_nodeready.nodeready</a></span>).
<span><a href=".././../../ocsigen-toolkit/latest/api/client/Ot_nodeready#VALnodeready">Ot_nodeready.nodeready</a></span> to wait for the element to be actually displayed).
</p><p>If such section is reached during module initialization on the server
(global client section), it will be executed on client side everytime
a new client side program is launched.
Expand Down Expand Up @@ -411,7 +411,8 @@
ask the client-side program to call the corresponding functions.
Their arguments (injections) are serialized at the same time by the
server-side program and also inserted in the generated page.</p></div><h3>Example</h3><p>This section shows a typical example of client-server code: call a function
when user clicks on a page element.
when user clicks on a page element. Take time to analyse this example,
as most of your code will probably be very similar.
</p><pre class="client" class=""><code class="language-ocaml translatable">open%client Js_of_ocaml
open%client Js_of_ocaml_lwt
open%client Eliom_content.Html</code></pre><pre class="shared" class=""><code class="language-ocaml translatable">open%shared Eliom_content.Html.F</code></pre><pre class="server" class=""><code class="language-ocaml translatable">let%server theservice =
Expand Down
9 changes: 5 additions & 4 deletions dev/manual/basics.html
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
This greatly simplifies communication between server and client.
</p><p>Pages can be generated either on the server or the client.
The first HTTP request usually returns a server-side generated HTML page
(thus indexable by search engines), but subsequent page generations are done
(thus indexable by search engines), but subsequent page generations can be done
by the client for better performance.
In a mobile app, all pages are usually generated on the client.
</p><p>One of the key features of Eliom is that it allows
Expand All @@ -370,7 +370,7 @@
</p><p class="centered"><img src="files/tutorial/client-server.svg" alt="Client-server build system" class="img-col-width-400"/>
</p><h3>Client values</h3><p>Fragments of client code can be included in server (or shared) sections.
</p><p>Example:
</p><pre class="server" class=""><code class="language-ocaml translatable">button ~a:[a_onclick [%client fun ev -&gt; ... ]] [ ... ]</code></pre><p>The syntax is <span class="teletype">[%client (&lt;value&gt; : &lt;type&gt;) </span>.
</p><pre class="server" class=""><code class="language-ocaml translatable">button ~a:[a_onclick [%client fun ev -&gt; ... ]] [ ... ]</code></pre><p>The syntax is <span class="teletype">[%client (&lt;value&gt; : &lt;type&gt;)]</span>.
Type annotation is almost always required.
</p><p>These client fragments can be manipulated as server side OCaml values:
</p><pre class="server" class=""><code class="language-ocaml translatable">let%server x : int Eliom_client_value.t = [%client 1 + 3 ]</code></pre><p>If such section is reached while generating a page on server side,
Expand All @@ -379,7 +379,7 @@
the client-side code will be executed immediately
(In that case, you can delay the execution, if needed,
for example with function
<span><a href=".././../../ocsigen-toolkit/latest/api/client/Ot_nodeready#VALnodeready">Ot_nodeready.nodeready</a></span>).
<span><a href=".././../../ocsigen-toolkit/latest/api/client/Ot_nodeready#VALnodeready">Ot_nodeready.nodeready</a></span> to wait for the element to be actually displayed).
</p><p>If such section is reached during module initialization on the server
(global client section), it will be executed on client side everytime
a new client side program is launched.
Expand Down Expand Up @@ -411,7 +411,8 @@
ask the client-side program to call the corresponding functions.
Their arguments (injections) are serialized at the same time by the
server-side program and also inserted in the generated page.</p></div><h3>Example</h3><p>This section shows a typical example of client-server code: call a function
when user clicks on a page element.
when user clicks on a page element. Take time to analyse this example,
as most of your code will probably be very similar.
</p><pre class="client" class=""><code class="language-ocaml translatable">open%client Js_of_ocaml
open%client Js_of_ocaml_lwt
open%client Eliom_content.Html</code></pre><pre class="shared" class=""><code class="language-ocaml translatable">open%shared Eliom_content.Html.F</code></pre><pre class="server" class=""><code class="language-ocaml translatable">let%server theservice =
Expand Down

0 comments on commit d114f6a

Please sign in to comment.