Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use Html5.P.print as suggested by @Drup on IRC
  • Loading branch information
hannesm committed May 7, 2016
1 parent 00c6226 commit f16291b
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions 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))
Expand Down Expand Up @@ -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.