This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
|
|
@ -0,0 +1,13 @@
|
|||
We can use our local packages, in our documentation thanks to dune's mdx stanza:
|
||||
|
||||
```ocaml
|
||||
# #require "pkg.public-lib";;
|
||||
# Public_lib.x;;
|
||||
- : int = 1
|
||||
```
|
||||
|
||||
```ocaml
|
||||
# #require "pkg2.public-lib2";;
|
||||
# Public_lib2.x;;
|
||||
- : int = 2
|
||||
```
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
(mdx
|
||||
(files README.md)
|
||||
(deps (package pkg2))
|
||||
(packages pkg))
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
(library
|
||||
(name public_lib)
|
||||
(public_name pkg.public-lib)
|
||||
(modules public_lib))
|
||||
|
|
@ -0,0 +1 @@
|
|||
let x = 1
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
(library
|
||||
(name public_lib2)
|
||||
(public_name pkg2.public-lib2)
|
||||
(modules public_lib2))
|
||||
|
|
@ -0,0 +1 @@
|
|||
let x = 2
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
Since version 0.2 the mdx stanza supports a more generic `deps` field.
|
||||
A deprecation warning is raised if using the olf `packages` field.
|
||||
|
||||
$ cat >dune-project <<EOF
|
||||
> (lang dune 3.0)
|
||||
> (using mdx 0.2)
|
||||
> (cram disable)
|
||||
> EOF
|
||||
|
||||
$ dune runtest
|
||||
File "dune", line 4, characters 1-15:
|
||||
4 | (packages pkg))
|
||||
^^^^^^^^^^^^^^
|
||||
Warning: 'packages' was deprecated in version 0.2 of mdx extension to verify
|
||||
code blocks in .md files.
|
||||
|
||||
But using the new field with the old stanza would fail
|
||||
|
||||
$ cat >dune-project <<EOF
|
||||
> (lang dune 2.8)
|
||||
> (using mdx 0.1)
|
||||
> EOF
|
||||
|
||||
$ dune runtest
|
||||
File "dune", line 3, characters 1-22:
|
||||
3 | (deps (package pkg2))
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
Error: 'deps' 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]
|
||||
Loading…
Add table
Add a link
Reference in a new issue