This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
|
|
@ -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
|
||||
```
|
||||
|
|
@ -0,0 +1 @@
|
|||
let y = 10
|
||||
|
|
@ -0,0 +1 @@
|
|||
let y = 20
|
||||
|
|
@ -0,0 +1 @@
|
|||
let x = 1
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
(mdx
|
||||
(files README.md)
|
||||
(preludes
|
||||
default.ml
|
||||
(env a a.ml)
|
||||
(env b b.ml)))
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
(lang dune 2.4)
|
||||
|
||||
(using mdx 0.1)
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
You can set MDX preludes using the preludes field of the stanza
|
||||
|
||||
$ dune runtest
|
||||
Loading…
Add table
Add a link
Reference in a new issue