Skip to content

Commit

Permalink
basics: small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
balat committed Dec 21, 2023
1 parent 627bacc commit fa8015e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions tutos/7.1/manual/basics.wiki
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ This greatly simplifies communication between server and client.

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.

Expand Down Expand Up @@ -547,7 +547,7 @@ Example:
button ~a:[a_onclick [%client fun ev -> ... ]] [ ... ]
>>

The syntax is {{{[%client (<value> : <type>) }}}.
The syntax is {{{[%client (<value> : <type>)]}}}.
Type annotation is almost always required.

These client fragments can be manipulated as server side OCaml values:
Expand All @@ -562,7 +562,7 @@ If such section is reached while generating a page on client side,
the client-side code will be executed immediately
(In that case, you can delay the execution, if needed,
for example with function
<<a_api project="ocsigen-toolkit" subproject="client"|val Ot_nodeready.nodeready>>).
<<a_api project="ocsigen-toolkit" subproject="client"|val Ot_nodeready.nodeready>> to wait for the element to be actually displayed).

If such section is reached during module initialization on the server
(global client section), it will be executed on client side everytime
Expand Down Expand Up @@ -618,7 +618,8 @@ server-side program and also inserted in the generated page.

===Example===
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.

<<code language="ocaml" class="client"|
open%client Js_of_ocaml
Expand Down
9 changes: 5 additions & 4 deletions tutos/dev/manual/basics.wiki
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ This greatly simplifies communication between server and client.

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.

Expand Down Expand Up @@ -547,7 +547,7 @@ Example:
button ~a:[a_onclick [%client fun ev -> ... ]] [ ... ]
>>

The syntax is {{{[%client (<value> : <type>) }}}.
The syntax is {{{[%client (<value> : <type>)]}}}.
Type annotation is almost always required.

These client fragments can be manipulated as server side OCaml values:
Expand All @@ -562,7 +562,7 @@ If such section is reached while generating a page on client side,
the client-side code will be executed immediately
(In that case, you can delay the execution, if needed,
for example with function
<<a_api project="ocsigen-toolkit" subproject="client"|val Ot_nodeready.nodeready>>).
<<a_api project="ocsigen-toolkit" subproject="client"|val Ot_nodeready.nodeready>> to wait for the element to be actually displayed).

If such section is reached during module initialization on the server
(global client section), it will be executed on client side everytime
Expand Down Expand Up @@ -618,7 +618,8 @@ server-side program and also inserted in the generated page.

===Example===
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.

<<code language="ocaml" class="client"|
open%client Js_of_ocaml
Expand Down

0 comments on commit fa8015e

Please sign in to comment.