Skip to content

Commit

Permalink
Backport fixes to 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
balat committed Mar 22, 2024
1 parent 70041aa commit 9bf324c
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions tutos/7.1/manual/application.wiki
Original file line number Diff line number Diff line change
Expand Up @@ -498,9 +498,9 @@ module%server Graffiti_app =
let global_data_path = None
end)
>>
<<code language="ocaml" class="shared"|
let%shared width = 700
let%shared height = 400
<<code language="ocaml" class="server"|
let%server width = 700
let%server height = 400
>>
<<code language="ocaml" class="client"|
let%client draw ctx ((r, g, b), size, (x1, y1), (x2, y2)) =
Expand Down Expand Up @@ -846,12 +846,9 @@ To install Ocsigen Toolkit, do:
opam install ocsigen-toolkit
}}}

In {{{Makefile.options}}}, created by Eliom's distillery, add
{{{ocsigen-toolkit.client}}} and {{{ocsigen-toolkit.server}}} to the
{{{CLIENT_PACKAGES}}}:
Add package {{{ocsigen-toolkit.server}}} to the {{{libraries}}} section of your {{{dune}}} file, and {{{ocsigen-toolkit.client}}} to the {{{libraries}}} section of your {{{client/dune}}} file.
<<code language="makefile"|
SERVER_PACKAGES := ... ocsigen-toolkit.server
CLIENT_PACKAGES := ... ocsigen-toolkit.client
(libraries eliom.server ... ocsigen-toolkit.server)
>>

To create the widget, we replace {{{page}}} by :
Expand Down Expand Up @@ -1009,8 +1006,7 @@ arrives. To do that, we will use the

For using Cairo, first, make sure that it is installed (it is
available as {{{cairo2}}} via OPAM). Second, add it to the
{{{SERVER_PACKAGES}}} in your {{{Makefile.options}}}: <<code
language="makefile"| SERVER_PACKAGES := ... cairo2 >>
{{{libraries}}} section in your {{{dune}}} file.

The {{{draw_server}}} function below is the equivalent of the
{{{draw}}} function on the server side and the {{{image_string}}}
Expand Down Expand Up @@ -1096,7 +1092,7 @@ let img = Eliom_content.Html.To_dom.of_img
~src:(Html.D.make_uri ~service:~%imageservice ())
())
in
img##.onload := Dom_html.handler (fun ev ->
img##.onload := Dom_html.handler (fun _ev ->
ctx##drawImage img 0. 0.; Js._false);
>>

Expand Down

0 comments on commit 9bf324c

Please sign in to comment.