Module Dot_extensionSource

Graphviz/DOT diagram extension for odoc.

Renders {@dot[...]} code blocks as diagrams. By default uses client-side JavaScript (Viz.js), but can render server-side to PNG/SVG with format option.

Example:

  {@dot layout=neato[
    digraph G {
      a -> b -> c;
      b -> d;
    }
Sourcemodule Block = Api.Block
Sourcemodule Inline = Api.Inline
Sourceval viz_js_url : string

The Viz.js library URL for client-side rendering

Sourceval viz_full_js_url : string
Sourceval diagram_counter : int ref

Generate a unique ID for each diagram

Sourceval fresh_id : unit -> string
Sourceval get_layout : [< `Binding of string Odoc_parser.Loc.with_location * string Odoc_parser.Loc.with_location | `Tag of 'a ] list -> string

Extract option values

Sourceval get_format : [< `Binding of string Odoc_parser.Loc.with_location * 'a Odoc_parser.Loc.with_location | `Tag of 'b ] list -> 'a option
Sourceval get_filename : [< `Binding of string Odoc_parser.Loc.with_location * 'a Odoc_parser.Loc.with_location | `Tag of 'b ] list -> 'a option
Sourceval get_dimensions : [< `Binding of string Odoc_parser.Loc.with_location * 'a Odoc_parser.Loc.with_location & string Odoc_parser.Loc.with_location * 'b Odoc_parser.Loc.with_location | `Tag of 'c & 'd ] list -> 'b option * 'a option
Sourceval has_graph_wrapper : string -> bool

Check if content looks like a complete DOT graph

Sourceval ensure_graph_wrapper : string -> string

Wrap content in a digraph if needed

Sourceval make_style : string option -> string option -> string

Build inline style string from dimensions

Sourceval run_dot : layout:string -> format:string -> string -> (bytes, string) result

Run the dot command to render to a specific format

Sourceval render_script : string -> string -> string -> string

JavaScript code to render a single diagram (for client-side rendering)

Sourceval dot_css : string

CSS for dot diagrams

Sourceval extension_info : Api.extension_info

Extension documentation