package jupyter-kernel
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Library to write jupyter kernels (interactive notebooks)
Install
dune-project
Dependency
Authors
Maintainers
Sources
0.7.tar.gz
md5=02b7275196a74dc2b28565328104fe61
sha512=5f642a682ebb314a939409751b76a1c6f1e8ac0c4f999c6f9ba38937f985cca172e3f361df4d264ce040fc93d7239e24583f987be8e339230606b6025a92178e
doc/src/jupyter-kernel.doc/Jupyter_kernel_doc.ml.html
Source file Jupyter_kernel_doc.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57module Document = Document module C = Jupyter_kernel.Client module H = Tyxml.Html type mime_data = Jupyter_kernel.Client.mime_data = { mime_type: string; mime_content: string; mime_b64: bool; } type 'a mime_printer = 'a -> mime_data (* display a document as HTML *) let to_html : Document.t -> [<Html_types.div] H.elt = let mk_header ~depth l = match depth with | 1 -> H.h1 l | 2 -> H.h2 l | 3 -> H.h3 l | 4 -> H.h4 l | 5 -> H.h5 l | n when n>=6 -> H.h6 l | _ -> assert false in let rec aux ~depth doc = H.div (List.map (aux_block ~depth) doc) and aux_block ~depth (b:Document.block) = let h = match b with | `S s -> mk_header ~depth [H.txt s] | `P s -> H.p [H.txt s] | `Pre s -> H.pre [H.txt s] | `L l -> H.ul (List.map (fun sub -> H.li [aux ~depth sub]) l) | `I (s,sub) -> let depth = depth+1 in H.div ( mk_header ~depth [H.txt s] :: List.map (aux_block ~depth) sub ) | `Tbl (heads, rows) -> let thead = let l = List.map (fun s -> H.th [H.txt s]) heads in H.thead [H.tr l] and rows = let depth=depth+1 in List.map (fun row -> H.tr (List.map (fun s -> H.td [aux ~depth s]) row)) rows in H.table ~thead rows in H.div [h] in aux ~depth:3 let mime_of_html (h:_ H.elt) : C.mime_data = let s = Format.asprintf "%a@." (H.pp_elt ()) h in {C.mime_type="text/html"; mime_content=s; mime_b64=false}
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>