realworldocaml / mdx

Execute code blocks inside your documentation
ISC License
269 stars 45 forks source link

Add support for preprocessors in the ocaml fragments of mdx files #441

Open mbarbin opened 1 year ago

mbarbin commented 1 year ago

I'm trying to use ppx annotations in the ocaml sections of an mdx file, and cannot figure out where to configure it. It seems there is no preprocess field in the (mdx) stanza (looking at 0.4).

```ocaml
let f () = [%sexp "Hello, Sexp!"]
```
```mdx-error
Line 1, characters 14-18:
Error: Uninterpreted extension 'sexp'.
```

On the other hand, using a @@deriving annotation in a type declaration doesn't trigger an error, but seems to be simply ignored.

```ocaml
# type t = int [@@deriving sexp_of]
type t = int
```

Do you confirm this is not supported at the moment? Thank you