Directives¶
likec4-view¶
Embeds one view as an interactive iframe. Dynamic views (sequences) share the same id space and embed identically.
.. likec4-view:: cloud-to-amazon
:height: 420px
:title: Upload flow
MyST form:
```{likec4-view} cloud-to-amazon
:height: 420px
```
Options: height (default 460px), title (iframe title, for accessibility), render
(see Static images), and mode — diagram (viewer default) or sequence,
which opens a dynamic view directly in its sequence rendering (appends the viewer’s
?dynamic= parameter):
.. likec4-view:: cloud-to-amazon
:mode: sequence
An unknown view id fails the build (works with -W).
Static images¶
render picks how the view is embedded: iframe (HTML default), png, jpg, or text.
It is a preference, not a demand — the same source builds for every output format:
.. likec4-view:: cloud
:render: png
:width: 80%
:alt: Cloud, structural view
On non-HTML builders (
latex/PDF,epub, …) views are images by default;:render: iframethere falls back to the builder’s default.On builders that can’t embed images at all (
text,man,linkcheck) everything is plain text and no image export runs.:render: jpgneeds"jpg"somewhere inlikec4_render(only PNG is exported unless asked).In image mode
width,height,alt,align,scalepass through to the image with the standard docutils validators;altdefaults totitle.:mode: sequenceworks in image mode too: dynamic views are exported a second time in sequence layout (--seq), and the directive picks that rendering. On non-dynamic views the option is ignored, as in the viewer.
likec4-model¶
Embeds the whole viewer gallery, or just links it:
.. likec4-model::
:height: 600px
.. likec4-model::
:link-only: