11[ ![ Build Status] ( https://img.shields.io/endpoint?url=https%3A%2F%2Fci.ocamllabs.io%2Fbadge%2Frealworldocaml%2Fmdx%2Fmain&logo=ocaml )] ( https://ci.ocamllabs.io/github/realworldocaml/mdx )
22
3- ## MDX
3+ # MDX
44
55MDX allows to execute code blocks inside markdown and mli/mld documentation
66to help keeping them up to date.
@@ -18,7 +18,7 @@ $ opam install mdx
1818If you want to contribute to the project, please see the
1919[ CONTRIBUTING.md] ( CONTRIBUTING.md ) .
2020
21- ### Basic Usage
21+ ## Basic Usage
2222
2323You can use MDX with your Markdown or ` .ml{i,d} ` documentation, which ensures
2424code in multi-line or verbatim code blocks is correct.
@@ -123,9 +123,9 @@ Dune only checks markdown files with `mdx`. E.g.,
123123 (files :standard *.mli))
124124```
125125
126- ### Supported Extensions
126+ ## Supported Extensions
127127
128- #### Labels
128+ ### Labels
129129
130130The blocks can be parameterized by ` mdx ` -specific labels, that
131131will change the way ` mdx ` interprets the block.
@@ -160,7 +160,7 @@ The possible labels are:
160160- ` set-VAR=VALUE ` -- set an environment variable
161161- ` unset-VAR ` -- unset an environment variable
162162
163- #### Shell Scripts
163+ ### Shell Scripts
164164
165165` ocaml-mdx ` interprets shell scripts inside ` sh ` code blocks as cram-like tests. The
166166syntax is the following:
@@ -211,7 +211,7 @@ MDX will also consider exit codes when the syntax `[<exit code>]`is used:
211211Note that nothing will be displayed when the exit code is 0 (e.g. in case
212212of success).
213213
214- #### OCaml Code
214+ ### OCaml Code
215215
216216MDX interprets OCaml fragments. It understands _ normal_ code fragments and
217217_ toplevel_ code fragments (starting with a ` # ` sign and optionally ending with
@@ -233,7 +233,7 @@ Here is an examples of toplevel OCaml code:
233233 42
234234 ```
235235
236- ### File sync
236+ ## File sync
237237
238238MDX is also capable of including content from files in fenced code blocks
239239using the label ` file ` . OCaml files can be sliced using named blocks:
@@ -258,9 +258,9 @@ Non-OCaml files can also be read and included in a block:
258258 ```
259259However, part splitting is only supported for OCaml files.
260260
261- ### Tests
261+ ## Tests
262262
263- #### Cram Tests
263+ ### Cram Tests
264264
265265Cram tests can be executed and checked with ` ocaml-mdx test <file.md> ` .
266266
@@ -274,7 +274,7 @@ Cram tests can be executed and checked with `ocaml-mdx test <file.md>`.
274274If the output is not consistent with what is expected,
275275` <file.md>.corrected ` is generated.
276276
277- #### OCaml
277+ ### OCaml
278278
279279To execute OCaml code and toplevel fragments, uses ` ocaml-mdx test <file.md> ` .
280280
@@ -286,9 +286,9 @@ To execute OCaml code and toplevel fragments, uses `ocaml-mdx test <file.md>`.
286286If the output is not consistent with what is expected
287287` <file.md>.corrected ` is generated.
288288
289- #### Non-deterministic Tests
289+ ### Non-deterministic Tests
290290
291- ** Non-deterministic Outputs**
291+ #### Non-deterministic Outputs
292292
293293` ocaml-mdx test ` supports non-deterministic outputs:
294294
@@ -303,7 +303,7 @@ generate `<file>.corrected` if the new output differs from the one
303303described in the file. Use ` ocaml-mdx test --non-deterministic <file> ` to come
304304back to the default behaviour.
305305
306- ** Non-deterministic Commands**
306+ #### Non-deterministic Commands
307307
308308` ocaml-mdx test ` supports non-deterministic commands:
309309
@@ -322,7 +322,7 @@ non-deterministic blocks. This is useful when not calling MDX directly but
322322through other commands like ` dune ` or Makefiles etc. Use
323323` MDX_RUN_NON_DETERMINISTIC=1 ocaml-mdx test ` in this case.
324324
325- #### Named execution environments (since mdx 1.1.0)
325+ ### Named execution environments (since mdx 1.1.0)
326326
327327Separate environments can be defined for blocks:
328328
@@ -359,7 +359,7 @@ We can retrieve the value of `x` in environment `e1`:
359359 - : int -> int = <fun>
360360 ```
361361
362- #### Matching on the OCaml version (since mdx 1.2.0)
362+ ### Matching on the OCaml version (since mdx 1.2.0)
363363
364364Blocks can be processed or ignored depending on the current version of OCaml.
365365
@@ -390,7 +390,7 @@ 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)
393+ ### Matching based on the ` os_type ` (since mdx 2.4.0)
394394
395395Block can be processed or ignored depending on the current
396396[ ` os_type ` ] ( https://v2.ocaml.org/api/Sys.html#VALos_type ) .
@@ -417,7 +417,7 @@ Windows or not:
417417The ` os_type ` values should be written in ASCII and are compared case
418418insensitively.
419419
420- #### Environment variables declaration
420+ ### Environment variables declaration
421421
422422Environment variables can be declared at the beginning of a block:
423423
0 commit comments