Commit cb01918
authored
Update the vendored odoc-parser (#2757)
Update to the new Odoc features:
- @toc_status and @order_category
- Structured code block tags syntax
- Indentation of code and verbatim blocks
Also backported formatting changes and code changes.
* odoc-parser: Code block and verbatim blocks indentation change
Odoc now strips the indentation from code and verbatim blocks. It
doesn't use the indentation of the least indented line, like
OCamlformat, but instead use the indentation of the block opening.
* odoc: Normalize `\\n` into newline
In code blocks, newlines can be turned into `\\n` (or the opposite) when
formatting string literals that need to break. Update the normalization
function to avoid crashing when that happens.
* odoc: Remove extra indentation in code blocks
The updated Odoc parser considers that code blocks horizontally start at
the opening bracket. It no longer uses the indentation of the least
indented line for that.
As a result, OCamlformat cannot indent code blocks without changing
their content.
The indentation is also removed in code blocks that are formatted, to
avoid adding visible indentation in rendered documentation.
* odoc: Don't fail for removed whitespaces in code blocks
During normalisation, allow whitespaces to disappear from code blocks.
This happens when code if formatted.1 parent 25d912f commit cb01918
File tree
39 files changed
+991
-717
lines changed- lib
- test/passing
- refs.ahrefs
- refs.default
- refs.janestreet
- refs.ocamlformat
- tests
- vendor/odoc-parser
39 files changed
+991
-717
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
9 | 16 | | |
10 | 17 | | |
11 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
41 | 63 | | |
42 | | - | |
43 | | - | |
44 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
45 | 77 | | |
46 | 78 | | |
47 | | - | |
| 79 | + | |
48 | 80 | | |
49 | 81 | | |
50 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
51 | 89 | | |
52 | 90 | | |
53 | 91 | | |
| |||
105 | 143 | | |
106 | 144 | | |
107 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
108 | 151 | | |
109 | 152 | | |
110 | 153 | | |
111 | 154 | | |
112 | 155 | | |
113 | | - | |
114 | | - | |
| 156 | + | |
115 | 157 | | |
116 | 158 | | |
117 | 159 | | |
118 | | - | |
| 160 | + | |
| 161 | + | |
119 | 162 | | |
120 | 163 | | |
121 | 164 | | |
| |||
179 | 222 | | |
180 | 223 | | |
181 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
182 | 229 | | |
183 | 230 | | |
184 | 231 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
98 | 110 | | |
99 | | - | |
100 | 111 | | |
101 | | - | |
102 | | - | |
103 | | - | |
| 112 | + | |
| 113 | + | |
104 | 114 | | |
105 | | - | |
| 115 | + | |
106 | 116 | | |
107 | 117 | | |
108 | 118 | | |
| |||
300 | 310 | | |
301 | 311 | | |
302 | 312 | | |
303 | | - | |
| 313 | + | |
304 | 314 | | |
305 | 315 | | |
306 | 316 | | |
| |||
431 | 441 | | |
432 | 442 | | |
433 | 443 | | |
434 | | - | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
435 | 449 | | |
436 | | - | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
437 | 453 | | |
438 | 454 | | |
439 | 455 | | |
440 | | - | |
| 456 | + | |
441 | 457 | | |
442 | 458 | | |
443 | 459 | | |
| |||
451 | 467 | | |
452 | 468 | | |
453 | 469 | | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | 470 | | |
465 | 471 | | |
466 | 472 | | |
467 | 473 | | |
468 | 474 | | |
469 | 475 | | |
470 | | - | |
| 476 | + | |
471 | 477 | | |
472 | 478 | | |
473 | 479 | | |
| |||
481 | 487 | | |
482 | 488 | | |
483 | 489 | | |
484 | | - | |
485 | | - | |
486 | | - | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
487 | 495 | | |
488 | 496 | | |
489 | 497 | | |
| |||
518 | 526 | | |
519 | 527 | | |
520 | 528 | | |
| 529 | + | |
| 530 | + | |
521 | 531 | | |
522 | 532 | | |
523 | 533 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 23 | + | |
27 | 24 | | |
28 | 25 | | |
29 | 26 | | |
| |||
38 | 35 | | |
39 | 36 | | |
40 | 37 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 38 | + | |
45 | 39 | | |
46 | 40 | | |
47 | 41 | | |
| |||
51 | 45 | | |
52 | 46 | | |
53 | 47 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 48 | + | |
58 | 49 | | |
59 | 50 | | |
60 | 51 | | |
| |||
68 | 59 | | |
69 | 60 | | |
70 | 61 | | |
71 | | - | |
72 | | - | |
73 | | - | |
| 62 | + | |
| 63 | + | |
74 | 64 | | |
75 | | - | |
76 | | - | |
77 | | - | |
| 65 | + | |
| 66 | + | |
78 | 67 | | |
79 | 68 | | |
80 | 69 | | |
81 | 70 | | |
82 | 71 | | |
83 | | - | |
84 | | - | |
85 | | - | |
| 72 | + | |
| 73 | + | |
86 | 74 | | |
87 | 75 | | |
88 | 76 | | |
89 | 77 | | |
90 | | - | |
91 | | - | |
| 78 | + | |
| 79 | + | |
92 | 80 | | |
0 commit comments