This commit is contained in:
swrup 2025-11-11 02:07:51 +01:00
parent aa2ff7b2f0
commit 2f3113f55d
11742 changed files with 1223940 additions and 0 deletions

View file

@ -0,0 +1,22 @@
Using the mdx stanza, you can set mdx prelude which are used to evaluate
code in the toplevel environments before checking a document. To do that
you can set the prelude field of the stanza: `(preludes <prelude_file> ...)`.
```ocaml
# x;;
- : int = 1
```
Different environment can have their own prelude. This is set using the
`(env <env_name> <prelude_file>)` syntax for the prelude field.
Here x and why are set in `alt.ml`.
```ocaml env=a
# x + y;;
- : int = 11
```
```ocaml env=b
# x + y;;
- : int = 21
```

View file

@ -0,0 +1,6 @@
(mdx
(files README.md)
(preludes
default.ml
(env a a.ml)
(env b b.ml)))

View file

@ -0,0 +1,3 @@
(lang dune 2.4)
(using mdx 0.1)

View file

@ -0,0 +1,3 @@
You can set MDX preludes using the preludes field of the stanza
$ dune runtest