Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add context renderer type definition and helper

  • Loading branch information...
commit 63caa542095e1b4394d8fecf63a07a7d3ff5f029 1 parent 2f313d9
@VictorNicollet authored
Showing with 24 additions and 0 deletions.
  1. +12 −0 src/html.ml
  2. +12 −0 src/html.mli
View
12 src/html.ml
@@ -93,6 +93,15 @@ type renderer =
-> JsCode.t
-> string
+type ('ctx) ctxrenderer =
+ ?css:string list
+ -> ?js:string list
+ -> ?head:string
+ -> ?favicon:string
+ -> ?body_classes:string list
+ -> title:string
+ -> writer
+ -> ('ctx,(JsCode.t -> string)) Run.t
let print_page ?(css=[]) ?(js=[]) ?(head="") ?favicon ?(body_classes=[]) ~title writer more_js =
@@ -145,3 +154,6 @@ let print_page ?(css=[]) ?(js=[]) ?(head="") ?favicon ?(body_classes=[]) ~title
(* Return the resulting string *)
Buffer.contents buffer
+
+let print_page_ctx ?css ?js ?head ?favicon ?body_classes ~title writer =
+ Run.return (print_page ?css ?js ?head ?favicon ?body_classes ~title writer)
View
12 src/html.mli
@@ -38,4 +38,16 @@ type renderer =
-> JsCode.t
-> string
+type ('ctx) ctxrenderer =
+ ?css:string list
+ -> ?js:string list
+ -> ?head:string
+ -> ?favicon:string
+ -> ?body_classes:string list
+ -> title:string
+ -> writer
+ -> ('ctx,(JsCode.t -> string)) Run.t
+
val print_page : renderer
+
+val print_page_ctx : 'any ctxrenderer
Please sign in to comment.
Something went wrong with that request. Please try again.