package hugin

  1. Overview
  2. Docs
Visualization library for OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

raven-1.0.0.alpha2.tbz
sha256=93abc49d075a1754442ccf495645bc4fdc83e4c66391ec8aca8fa15d2b4f44d2
sha512=5eb958c51f30ae46abded4c96f48d1825f79c7ce03f975f9a6237cdfed0d62c0b4a0774296694def391573d849d1f869919c49008acffca95946b818ad325f6f

doc/src/hugin.top/hugin_top.ml.html

Source file hugin_top.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
let install_printer (ident : string) =
  let lexbuf = Lexing.from_string ident in
  try
    let longident = Parse.longident lexbuf in
    Topdirs.dir_install_printer Format.err_formatter longident
  with ex ->
    Format.fprintf Format.err_formatter "Failed to install printer %s: %s@."
      ident (Printexc.to_string ex)

let pp_hugin_figure fmt figure =
  let image_data = Hugin.render figure in
  let base64_data = Base64.encode_string image_data in
  Format.fprintf fmt "![figure](data:image/png;base64,%s)" base64_data

let () = install_printer "Hugin_top.pp_hugin_figure"