Skip to content

Commit e075e57

Browse files
committed
Add documentation on the new os_type label
1 parent 2d6f4a6 commit e075e57

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,33 @@ The version number can be of the following forms:
390390
- `X.Y`
391391
- `X.Y.Z`
392392

393+
#### Matching based on the `os_type` (since mdx 2.4.0)
394+
395+
Block can be processed or ignored depending on the current
396+
[`os_type`](https://v2.ocaml.org/api/Sys.html#VALos_type).
397+
398+
For example, different blocks could be enabled depending on whether we are on
399+
Windows or not:
400+
401+
```ocaml
402+
#require "unix"
403+
```
404+
405+
<!-- $MDX os_type<>Win32 -->
406+
```ocaml
407+
# Unix.nice 0
408+
- : int = 0
409+
```
410+
411+
<!-- $MDX os_type=Win32 -->
412+
```ocaml
413+
# Unix.nice 0
414+
Exception: Invalid_argument "Unix.nice not implemented".
415+
```
416+
417+
The `os_type` values should be written in ASCII and are compared case
418+
insensitively.
419+
393420
#### Environment variables declaration
394421

395422
Environment variables can be declared at the beginning of a block:

0 commit comments

Comments
 (0)