Msc_extensionSourceMessage Sequence Chart extension for odoc.
Renders {@msc[...]} code blocks as sequence diagrams. By default uses client-side JavaScript (mscgen-inpage), but can render server-side to PNG/SVG with format option (requires mscgen).
Example:
{@msc format=png width=600px[
msc {
a, b, c;
a -> b [label="request"];
b -> c [label="forward"];
c -> b [label="response"];
b -> a [label="reply"];
}MscGen.js CDN URL - the inpage version auto-renders on DOMContentLoaded
Script to load mscgenjs with defer-like behavior
val get_style :
[< `Binding of
string Odoc_parser.Loc.with_location
* string Odoc_parser.Loc.with_location
| `Tag of 'a ]
list ->
stringExtract option values
val get_format :
[< `Binding of
string Odoc_parser.Loc.with_location * 'a Odoc_parser.Loc.with_location
| `Tag of 'b ]
list ->
'a optionval get_filename :
[< `Binding of
string Odoc_parser.Loc.with_location * 'a Odoc_parser.Loc.with_location
| `Tag of 'b ]
list ->
'a optionval 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 optionExtract CSS dimensions
Build inline style string from dimensions
HTML-escape content for safe embedding
Run mscgen to render to a specific format
CSS for MSC diagrams
Extension documentation