diff --git a/src/plugins/server/data.mli b/src/plugins/server/data.mli index bef386bf9e42fad28c52d5035b405a5fb165fc05..87305705e39ce58bae376ff62110aa8b0732c062 100644 --- a/src/plugins/server/data.mli +++ b/src/plugins/server/data.mli @@ -159,11 +159,11 @@ val declare : {[ (* ---- Exemple of Record Data --- *) type r - let s = Record.signature ~page ~kind ~name ~descr () in + let s = Record.signature () in let fd_a = Record.field s ~name:"a" ~descr:"..." (module A) in let fd_b = Record.field s ~name:"b" ~descr:"..." (module B) in - - module M = (val (Record.publish s) : Record with type r = r) + let r = Record.publish s ~page ~kind ~name ~descr + module M = (val r) : Record with type r = r) let make a b = M.default |> M.set fd_a a |> M.set fd_b b ]} diff --git a/src/plugins/server/request.mli b/src/plugins/server/request.mli index 3fe2933425cba1e63980bcc07b4adc98b5d3f442..58cfd275a8cd0b598f4d65c8cd37cbe0d1a48549 100644 --- a/src/plugins/server/request.mli +++ b/src/plugins/server/request.mli @@ -114,12 +114,12 @@ val register : {[ (* ---- Exemple of Request Registration --- *) let () = - let s = Request.signature ~page ~kind ~name ~descr () in + let s = Request.signature () in let get_a = Request.param s ~name:"a" ~descr:"..." (module A) in let get_b = Request.param s ~name:"b" ~descr:"..." (module B) in let set_c = Request.result s ~name:"c" ~descr:"..." (module C) in let set_d = Request.result s ~name:"d" ~descr:"..." (module D) in - Request.register_sig s + Request.register_sig s ~package ~kind ~name ~descr (fun rq () -> let (c,d) = some_job (get_a rq) (get_b rq) in set_c rq c ; set_d rq d) diff --git a/src/plugins/server/server_doc.ml b/src/plugins/server/server_doc.ml index 007c88ce26169424d17a82635bb786fc9f086449..a1c14afd4fd0a02cc7ee8357fc5fcfb4d15cf24e 100644 --- a/src/plugins/server/server_doc.ml +++ b/src/plugins/server/server_doc.ml @@ -157,6 +157,12 @@ let md_named ~kind pp = function let title = String.capitalize_ascii kind in Md.table (Package.md_fields ~title pp prms) +let md_signals signals = + if signals = [] then [] + else + Md.quote (Md.emph "signals") @ + Md.block Md.(list (List.map (fun x -> text (code x)) signals)) + let descr_of_decl names decl = match decl.d_kind with | D_safe _ | D_loose _ | D_order _ -> assert false @@ -181,9 +187,7 @@ let descr_of_decl names decl = Md.quote (md_param ~kind:"output" pp rq.rq_output) @ md_named ~kind:"input" pp rq.rq_input @ md_named ~kind:"output" pp rq.rq_output @ - Md.quote (Md.emph "signals") @ - Md.block Md.(list (List.map (fun x -> text (code x)) - rq.rq_signals)) + md_signals rq.rq_signals let declaration page names decl = match decl.d_kind with