@@ -460,7 +460,8 @@ The directive supports the same layout options as the standard `image` and
460460` :target: ` * (URL or empty)*
461461: Makes the diagram clickable. When set without a value, the raw SVG is
462462 saved as a file and linked so users can open it in a new tab for
463- full-resolution zooming — useful for large or complex diagrams.
463+ full-resolution zooming, useful for large or complex diagrams. The link is relative to
464+ the page, so it also works when the documentation is served below a URL prefix.
464465
465466` :class: ` * (space-separated strings)*
466467: Extra CSS classes for the wrapper element.
@@ -486,6 +487,8 @@ JupyterLab cells — no extra code needed:
486487![ Approval machine on JupyterLab] ( images/lab_approval_machine_accepted.png )
487488
488489
490+ (diagram-graphviz-errors)=
491+
489492## When Graphviz fails
490493
491494Every path that runs ` dot ` (the ` svg ` format, ` _repr_svg_() ` in Jupyter, the command line
@@ -496,10 +499,11 @@ what Graphviz wrote to stderr, such as
496499` Error: <stdin>: syntax error in line 25 near ',' ` . The Sphinx directive reports the same
497500text as a build warning.
498501
499- A missing program raises {class}` ~statemachine.contrib.diagram.GraphvizNotFoundError ` , a
500- subclass of both ` GraphvizError ` and {class}` FileNotFoundError ` . Catch ` GraphvizError ` to
501- handle every case; code that skips diagrams with ` except FileNotFoundError ` when Graphviz is
502- not installed keeps working:
502+ ` GraphvizError ` is a {class}` ~statemachine.exceptions.StateMachineError ` . A missing program
503+ raises {class}` ~statemachine.contrib.diagram.GraphvizNotFoundError ` , a subclass of both
504+ ` GraphvizError ` and {class}` FileNotFoundError ` . Catch ` GraphvizError ` to handle every case;
505+ code that skips diagrams with ` except FileNotFoundError ` when Graphviz is not installed keeps
506+ working:
503507
504508``` py
505509>> > from statemachine.contrib.diagram import GraphvizError
0 commit comments