diff --git a/doc/10.x/manual/clientserver-communication.wiki b/doc/10.x/manual/clientserver-communication.wiki index 9f51ed807c..b6990ff976 100644 --- a/doc/10.x/manual/clientserver-communication.wiki +++ b/doc/10.x/manual/clientserver-communication.wiki @@ -177,13 +177,11 @@ data you want to be able to send to the server using our {{{ppx_deriving}}} syntax extension: <> This type can now be used as a parameter for a service: diff --git a/doc/10.x/manual/clientserver-html.wiki b/doc/10.x/manual/clientserver-html.wiki index 382605b2ab..683ac62b27 100644 --- a/doc/10.x/manual/clientserver-html.wiki +++ b/doc/10.x/manual/clientserver-html.wiki @@ -55,22 +55,22 @@ For example, here is a {{{div}}} element built with TyXML and then converted to the DOM representation using the module << a_api subproject="client" | module Eliom_content.Html >>: -<> And here the same built using the DOM API: -<> +<> +< acc | n -> aux (s.[n - 1] :: acc) (pred n) in aux [] len - let value_signal, set_value = React.S.create "initial" +let%client value_signal, set_value = React.S.create "initial" - let value_len = React.S.map String.length value_signal +let%client value_len = React.S.map String.length value_signal - let content_signal : Html_types.div_content_fun elt React.signal = +let%client content_signal : Html_types.div_content_fun elt React.signal = React.S.map (fun value -> let l = split value in @@ -253,21 +251,20 @@ module Reactivenodes_app = )) value_signal - let make_color len = +let%client make_color len = let d = (len * 10) mod 255 in Printf.sprintf "color: rgb(%d,%d,%d)" d d d - let make_client_nodes () = +let%client make_client_nodes () = [ D.p [R.txt value_signal]; D.p ~a:[ R.a_style (React.S.map make_color value_len)] [R.txt value_signal]; R.node content_signal ] - -] - -let make_input () = +>> +< @@ -280,13 +277,13 @@ let make_input () = ] in inp -let main_service = +let%server main_service = Eliom_service.create ~path:(Eliom_service.Path []) ~meth:(Eliom_service.Get Eliom_parameter.unit) () -let () = +let%server () = Reactivenodes_app.register ~service:main_service (fun () () -> @@ -311,43 +308,41 @@ reactive nodes in a server-side generated page. ==== Example -<> +<> +<> +< @@ -387,30 +382,30 @@ val create_global_elt: 'a elt -> 'a elt In the following example, the content of {{{global_list}}} will be preserved when you click on the "reload page" link. -<> +< let page_number = incr cpt; string_of_int !cpt in @@ -438,25 +433,25 @@ application. In the following code snippet, the alert "global script" is displayed only once, while the alert "non global script" is display every time you click on the "reload page" link. -< Lwt.return @@ -479,8 +474,8 @@ See <>. The last possibility is to use untyped HTML. Just build strings containing your pages. Here is an example: -<> -<> -<> ==== Injecting ==== diff --git a/doc/dev/manual/clientserver-communication.wiki b/doc/dev/manual/clientserver-communication.wiki index 9f51ed807c..b6990ff976 100644 --- a/doc/dev/manual/clientserver-communication.wiki +++ b/doc/dev/manual/clientserver-communication.wiki @@ -177,13 +177,11 @@ data you want to be able to send to the server using our {{{ppx_deriving}}} syntax extension: <> This type can now be used as a parameter for a service: diff --git a/doc/dev/manual/clientserver-html.wiki b/doc/dev/manual/clientserver-html.wiki index 382605b2ab..683ac62b27 100644 --- a/doc/dev/manual/clientserver-html.wiki +++ b/doc/dev/manual/clientserver-html.wiki @@ -55,22 +55,22 @@ For example, here is a {{{div}}} element built with TyXML and then converted to the DOM representation using the module << a_api subproject="client" | module Eliom_content.Html >>: -<> And here the same built using the DOM API: -<> +<> +< acc | n -> aux (s.[n - 1] :: acc) (pred n) in aux [] len - let value_signal, set_value = React.S.create "initial" +let%client value_signal, set_value = React.S.create "initial" - let value_len = React.S.map String.length value_signal +let%client value_len = React.S.map String.length value_signal - let content_signal : Html_types.div_content_fun elt React.signal = +let%client content_signal : Html_types.div_content_fun elt React.signal = React.S.map (fun value -> let l = split value in @@ -253,21 +251,20 @@ module Reactivenodes_app = )) value_signal - let make_color len = +let%client make_color len = let d = (len * 10) mod 255 in Printf.sprintf "color: rgb(%d,%d,%d)" d d d - let make_client_nodes () = +let%client make_client_nodes () = [ D.p [R.txt value_signal]; D.p ~a:[ R.a_style (React.S.map make_color value_len)] [R.txt value_signal]; R.node content_signal ] - -] - -let make_input () = +>> +< @@ -280,13 +277,13 @@ let make_input () = ] in inp -let main_service = +let%server main_service = Eliom_service.create ~path:(Eliom_service.Path []) ~meth:(Eliom_service.Get Eliom_parameter.unit) () -let () = +let%server () = Reactivenodes_app.register ~service:main_service (fun () () -> @@ -311,43 +308,41 @@ reactive nodes in a server-side generated page. ==== Example -<> +<> +<> +< @@ -387,30 +382,30 @@ val create_global_elt: 'a elt -> 'a elt In the following example, the content of {{{global_list}}} will be preserved when you click on the "reload page" link. -<> +< let page_number = incr cpt; string_of_int !cpt in @@ -438,25 +433,25 @@ application. In the following code snippet, the alert "global script" is displayed only once, while the alert "non global script" is display every time you click on the "reload page" link. -< Lwt.return @@ -479,8 +474,8 @@ See <>. The last possibility is to use untyped HTML. Just build strings containing your pages. Here is an example: -<> -<> -<> ==== Injecting ====