How to make code example using tidy package?

I’m not familiar with the package tidy, but I do want to use it to make some code example like:


Followed with the instructions, I use code:

#let docs = tidy.parse-module(read("/example/page_style.typ"))
#tidy.show-module(docs, style: tidy.styles.default)

and in another file page_style.typ, the content is

/// #example(`text(size: .9em)[example]`)

But nothing shows in my main document.

Is there anything wrong with my code? I would really be appreciated if anybody gives me advice on how to make code example.

Hello, I am unable to reproduce your issue. Have you managed to make it work?

Here is what I use
main.typ

#import "@preview/tidy:0.3.0"

#let docs = tidy.parse-module(read("/page_style.typ"))
#tidy.show-module(docs, style: tidy.styles.default)

page_style.typ

/// #example(`text(size: .9em)[example]`)
#let foo() = {}

Output