Gitlab is now running v13.9.0 - More info -> here <-

Commit 6c720711 authored by Philippe Veber's avatar Philippe Veber

tk/Note: support for html tables is back

parent 778e8a72
......@@ -3,6 +3,7 @@ open Core_kernel
type elt =
| Text of string
| Dataframe of Dataframe.t * (string * Dataframe.html_formatter) list
| Table of Html_types.table Tyxml.Html.elt
| Png of string
| Svg of string
| Croquis of {
......@@ -26,6 +27,7 @@ let dataframe ?(formatters = []) d = Dataframe (d, formatters)
let png fn = Png fn
let svg fn = Svg fn
let croquis ?width ?height picture = Croquis { picture ; width ; height }
let table t = Table t
let render_picture format data buf =
let format = match format with
......@@ -43,6 +45,11 @@ let render_dataframe formatters data buf =
Tyxml.Html.pp_elt () fmt (Dataframe.to_html ~formatters data) ;
Format.pp_print_flush fmt ()
let render_html_elt data buf =
let fmt = Format.formatter_of_buffer buf in
Tyxml.Html.pp_elt () fmt data ;
Format.pp_print_flush fmt ()
let render_croquis ?width ?height croquis buf =
let open Biotk_croquis.Croquis in
let data =
......@@ -71,6 +78,7 @@ let render_doc doc =
| Dataframe (data, formatters) -> render_dataframe formatters data buf
| Croquis { width ; height ; picture } ->
render_croquis ?width ?height picture buf
| Table t -> render_html_elt t buf
) ;
Buffer.add_string buf "\n\n"
) ;
......
......@@ -9,6 +9,8 @@ val dataframe :
Dataframe.t ->
elt
val table : Html_types.table Tyxml.Html.elt -> elt
val png : string -> elt
val svg : string -> elt
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment