File tree Expand file tree Collapse file tree 6 files changed +21
-12
lines changed
include-without-file-label Expand file tree Collapse file tree 6 files changed +21
-12
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ let pp ppf = function
108108 Fmt. pf ppf " version%a%a" Relation. pp op Ocaml_version. pp v
109109 | Set (v , x ) -> Fmt. pf ppf " set-%s=%s" v x
110110 | Unset x -> Fmt. pf ppf " unset-%s" x
111- | Block_type bt -> Fmt. pf ppf " block- type=%a" pp_block_type bt
111+ | Block_type bt -> Fmt. pf ppf " type=%a" pp_block_type bt
112112
113113let is_prefix ~prefix s =
114114 let len_prefix = String. length prefix in
@@ -197,7 +197,7 @@ let interpret label value =
197197 | "file" -> requires_eq_value ~label ~value (fun x -> Ok (File x))
198198 | "part" -> requires_eq_value ~label ~value (fun x -> Ok (Part x))
199199 | "env" -> requires_eq_value ~label ~value (fun x -> Ok (Env x))
200- | "block- type" ->
200+ | "type" ->
201201 requires_eq_value ~label ~value
202202 (fun x -> parse_block_type_value ~label x >> = fun bt -> Ok (Block_type bt))
203203 | l when is_prefix ~prefix: " set-" l ->
Original file line number Diff line number Diff line change @@ -5,15 +5,18 @@ inference which can sometime lead to troublesome error messages.
55The following blocks use a volontarily misleading language header that would
66normally lead to errors if we let MDX infer the type of block based on them.
77
8- ``` sh block-type=toplevel
8+ <!-- $MDX type=toplevel -->
9+ ``` sh
910# 1 + 1;;
1011```
1112
12- ``` sh block-type=ocaml
13+ <!-- $MDX type=ocaml -->
14+ ``` sh
1315let x = 2
1416```
1517
16- ``` ocaml block-type=cram
18+ <!-- $MDX type=cram -->
19+ ``` ocaml
1720$ echo "boom"
1821```
1922
Original file line number Diff line number Diff line change @@ -5,16 +5,19 @@ inference which can sometime lead to troublesome error messages.
55The following blocks use a volontarily misleading language header that would
66normally lead to errors if we let MDX infer the type of block based on them.
77
8- ```ocaml block-type=toplevel
8+ <!-- $MDX type=toplevel -->
9+ ```ocaml
910# 1 + 1;;
1011- : int = 2
1112```
1213
13- ```ocaml block-type=ocaml
14+ <!-- $MDX type=ocaml -->
15+ ```ocaml
1416let x = 2
1517```
1618
17- ```sh block-type=cram
19+ <!-- $MDX type=cram -->
20+ ```sh
1821$ echo "boom"
1922boom
2023```
Original file line number Diff line number Diff line change @@ -3,10 +3,12 @@ is misused.
33
44It requires a value
55
6- ``` ocaml block-type
6+ <!-- $MDX type -->
7+ ``` ocaml
78```
89
910It only accept a fixed set of values
1011
11- ``` ocaml block-type=invalid
12+ <!-- $MDX type=invalid -->
13+ ``` ocaml
1214```
Original file line number Diff line number Diff line change 1- [mdx] Fatal error: File "test-case.md", line 6: invalid code block: Label `block- type` requires a value.
1+ [mdx] Fatal error: File "test-case.md", line 6: invalid code block: Label `type` requires a value.
Original file line number Diff line number Diff line change 11Explicitly setting the block-type to include has little benefits except
22for warning you that the ` file=... ` label is mandatory.
33
4- ``` ocaml block-type=include
4+ <!-- $MDX type=include -->
5+ ``` ocaml
56```
You can’t perform that action at this time.
0 commit comments