How can I create a vertical example preview with tidy in code?

I want to have create an example with tidy where the output is below the code.
However, the other examples should still display the preview horizontally.
I’ve found this in the documentation


The problem is I don’t create this example in a doc-string but in Typst code, where this function does not seem to exist (it also isn’t documented).

I figured it out.

Instead of just having an example code block like one would have in a doc-string,
you need to call show-example explicitly.

#tidy.show-example.show-example(
  // ...
  layout: tidy.show-example.default-layout-example.with(
    dir: ttb,
  ),
)
1 Like