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,6 @@
We can use our local libraries, in our documentation thanks to dune's mdx stanza:
```ocaml
# Private_lib.x;;
- : int = 42
```

View file

@ -0,0 +1,3 @@
(mdx
(files README.md)
(libraries private_lib))

View file

@ -0,0 +1,3 @@
(library
(name private_lib)
(modules private_lib))

View file

@ -0,0 +1,25 @@
Since 0.2 you can use the `libraries` field to have them linked into the test executable
$ cat >dune-project <<EOF
> (lang dune 3.0)
> (using mdx 0.2)
> (cram disable)
> EOF
$ dune runtest
MDX stanza 0.1 does not support linking libraries
$ cat >dune-project <<EOF
> (lang dune 2.8)
> (using mdx 0.1)
> EOF
$ dune runtest
File "dune", line 3, characters 1-24:
3 | (libraries private_lib))
^^^^^^^^^^^^^^^^^^^^^^^
Error: 'libraries' is only available since version 0.2 of mdx extension to
verify code blocks in .md files. Please update your dune-project file to have
(using mdx 0.2).
[1]