Permalink
Browse files

use Html5.P.print as suggested by @Drup on IRC

  • Loading branch information...
hannesm committed May 7, 2016
1 parent 00c6226 commit f16291b67d203bf6b2ebc0c5c8479b7cfd153683
Showing with 4 additions and 14 deletions.
  1. +4 −14 page.ml
18 page.ml
@@ -1,17 +1,5 @@
open Html5.M
module StringPrinter = struct
type out = string
type m = string
let empty = ""
let concat = (^)
let put a = a
let make a = a
end
module StringHtml = Html5.Make_printer(StringPrinter)
let header title =
head
(Html5.M.title (pcdata title))
@@ -134,7 +122,9 @@ let content =
]
let render =
Cstruct.of_string @@ StringHtml.print @@
let buf = Buffer.create 500 in
Html5.P.print ~output:(Buffer.add_string buf) @@
html
(header "not quite so broken")
(body [ content ])
(body [ content ]) ;
Cstruct.of_string @@ Buffer.contents buf

0 comments on commit f16291b

Please sign in to comment.