this repo has no description

stubs.js: remove duplicate primitives, fix free-variables warnings, add -linkall to scrollycode test

- Remove 12 JS stubs from js_top_worker that are already provided by
basement/runtime.js and base/runtime.js (blocking_mutex, blocking_condition,
thread_yield, basement_dynamic, basement_alloc_stack_bind, caml_ml_domain_index)
- Keep caml_make_local_vect as it's needed by OxCaml compiler-libs and base
is not a transitive dependency
- Fix free-variables warnings by using proper //Provides/Requires pattern
for domain TLS shared state
- Add (link_flags (-linkall)) to odoc-scrollycode-extension test binary so
Html_page's side-effect shell registration is linked (matches real odoc binary)
- Promote test expected outputs for OCaml 5.4.1 and scrollycode extension changes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+199 -327
+15 -12
test/generators/html/Markup.html
··· 29 29 //]]> 30 30 31 31 </script> 32 + <script> 33 + 34 + //<![CDATA[ 35 + (function(){if(window.__xOcamlLoaded)return;window.__xOcamlLoaded=true;var s=document.createElement('script');s.src='./_x-ocaml/x-ocaml.js';s.setAttribute('src-worker','./_x-ocaml/worker.js');s.setAttribute('backend','builtin');document.head.appendChild(s)})(); 36 + //]]> 37 + 38 + </script> 32 39 </head> 33 40 <body class="odoc"> 34 41 <nav class="odoc-nav"><a href="index.html">Up</a> – ··· 167 174 <h2 id="preformatted-text"> 168 175 <a href="#preformatted-text" class="anchor"></a>Preformatted text 169 176 </h2><p>This is a code block:</p> 170 - <pre class="language-ocaml"> 171 - <code> 172 - let foo = () 173 - (** There are some nested comments in here, but an unpaired comment 174 - terminator would terminate the whole doc surrounding comment. 175 - It's 176 - best to keep code blocks no wider than 72 characters. *) 177 - 178 - let bar = 179 - ignore foo 180 - </code> 181 - </pre><p>There are also verbatim blocks:</p> 177 + <x-ocaml mode="interactive"> let foo = () 178 + (** There are some nested comments in here, but an unpaired comment 179 + terminator would terminate the whole doc surrounding comment. It's 180 + best to keep code blocks no wider than 72 characters. *) 181 + 182 + let bar = 183 + ignore foo</x-ocaml> 184 + <p>There are also verbatim blocks:</p> 182 185 <pre>The main difference is these don't get syntax highlighting.</pre> 183 186 <h2 id="lists"><a href="#lists" class="anchor"></a>Lists</h2> 184 187 <ul><li>This is a</li><li>shorthand bulleted list,</li>
+2 -4
test/generators/html/Recent.html
··· 324 324 <code> 325 325 <span><span class="keyword">val</span> f : 326 326 <span> 327 - <span> 328 - <span>(<span class="label">x</span>:int * 329 - <span class="label">y</span>:int) 330 - </span> <a href="#type-phantom">phantom</a> 327 + <span><span>(x:int * y:int)</span> 328 + <a href="#type-phantom">Recent.phantom</a> 331 329 </span> <span class="arrow">&#45;&gt;</span> 332 330 </span> unit 333 331 </span>
+1 -9
test/generators/latex/Markup.tex
··· 44 44 This is a reference to \hyperref[Markup--val-foo]{\ocamlinlinecode{\ocamlinlinecode{foo}}[p\pageref*{Markup--val-foo}]}. References can have replacement text: \hyperref[Markup--val-foo]{\ocamlinlinecode{the value foo}[p\pageref*{Markup--val-foo}]}. Except for the special lookup support, references are pretty much just like links. The replacement text can have nested styles: \hyperref[Markup--val-foo]{\ocamlinlinecode{\bold{bold}}[p\pageref*{Markup--val-foo}]}, \hyperref[Markup--val-foo]{\ocamlinlinecode{\emph{italic}}[p\pageref*{Markup--val-foo}]}, \hyperref[Markup--val-foo]{\ocamlinlinecode{\emph{emphasis}}[p\pageref*{Markup--val-foo}]}, \hyperref[Markup--val-foo]{\ocamlinlinecode{super\textsuperscript{script}}[p\pageref*{Markup--val-foo}]}, \hyperref[Markup--val-foo]{\ocamlinlinecode{sub\textsubscript{script}}[p\pageref*{Markup--val-foo}]}, and \hyperref[Markup--val-foo]{\ocamlinlinecode{\ocamlinlinecode{code}}[p\pageref*{Markup--val-foo}]}. It's also possible to surround a reference in a style: \bold{\hyperref[Markup--val-foo]{\ocamlinlinecode{\ocamlinlinecode{foo}}[p\pageref*{Markup--val-foo}]}}. References can't be nested inside references, and links and references can't be nested inside each other. 45 45 46 46 \subsection{Preformatted text\label{Markup--preformatted-text}}% 47 - This is a code block:\medbreak 48 - \begin{ocamlcodeblock} 49 - let foo = () 50 - (** There are some nested comments in here, but an unpaired comment 51 - terminator would terminate the whole doc surrounding comment. It's 52 - best to keep code blocks no wider than 72 characters. *) 47 + This is a code block: 53 48 54 - let bar = 55 - ignore foo 56 - \end{ocamlcodeblock}\medbreak 57 49 There are also verbatim blocks: 58 50 59 51 \begin{verbatim}The main difference is these don't get syntax highlighting.\end{verbatim}%
+8 -36
test/generators/latex/Recent.tex
··· 22 22 \ocamlcodefragment{\}}\label{Recent--type-variant.E}% 23 23 \begin{ocamlindent}\end{ocamlindent}% 24 24 \end{ocamlindent}% 25 - <<<<<<< HEAD 26 - \label{Recent--type-gadt}\ocamlcodefragment{\ocamltag{keyword}{type} \_\allowbreak{} gadt = }\begin{ocamlindent}\ocamlcodefragment{| \ocamltag{constructor}{A} : int \hyperref[Recent--type-gadt]{\ocamlinlinecode{gadt}}}\label{Recent--type-gadt.A}% 25 + \label{Recent--type-gadt}\ocamlcodefragment{\ocamltag{keyword}{type} \_\allowbreak{} gadt = }\begin{ocamlindent}\ocamlcodefragment{| \ocamltag{constructor}{A} : int \hyperref[Recent--type-gadt]{\ocamlinlinecode{Recent.\allowbreak{}gadt}}}\label{Recent--type-gadt.A}% 27 26 \begin{ocamlindent}\end{ocamlindent}% 28 - \ocamlcodefragment{| \ocamltag{constructor}{B} : int \ocamltag{arrow}{$\rightarrow$} string \hyperref[Recent--type-gadt]{\ocamlinlinecode{gadt}}}\label{Recent--type-gadt.B}% 29 - ======= 30 - \label{Recent-type-gadt}\ocamlcodefragment{\ocamltag{keyword}{type} \_\allowbreak{} gadt = }\begin{ocamlindent}\ocamlcodefragment{| \ocamltag{constructor}{A} : int \hyperref[Recent-type-gadt]{\ocamlinlinecode{Recent.\allowbreak{}gadt}}}\label{Recent-type-gadt.A}% 31 - \begin{ocamlindent}\end{ocamlindent}% 32 - \ocamlcodefragment{| \ocamltag{constructor}{B} : int \ocamltag{arrow}{$\rightarrow$} string \hyperref[Recent-type-gadt]{\ocamlinlinecode{Recent.\allowbreak{}gadt}}}\label{Recent-type-gadt.B}% 33 - >>>>>>> baf34b7f4 (Add markdown to generator tests) 27 + \ocamlcodefragment{| \ocamltag{constructor}{B} : int \ocamltag{arrow}{$\rightarrow$} string \hyperref[Recent--type-gadt]{\ocamlinlinecode{Recent.\allowbreak{}gadt}}}\label{Recent--type-gadt.B}% 34 28 \begin{ocamlindent}foo\end{ocamlindent}% 35 29 \ocamlcodefragment{| \ocamltag{constructor}{C} : \{}\\ 36 30 \begin{ocamltabular}{p{1.000\textwidth}}\ocamlinlinecode{a : int;\allowbreak{}}\label{Recent--type-gadt.a}\\ 37 31 \end{ocamltabular}% 38 32 \\ 39 - <<<<<<< HEAD 40 - \ocamlcodefragment{\} \ocamltag{arrow}{$\rightarrow$} unit \hyperref[Recent--type-gadt]{\ocamlinlinecode{gadt}}}\label{Recent--type-gadt.C}% 41 - ======= 42 - \ocamlcodefragment{\} \ocamltag{arrow}{$\rightarrow$} unit \hyperref[Recent-type-gadt]{\ocamlinlinecode{Recent.\allowbreak{}gadt}}}\label{Recent-type-gadt.C}% 43 - >>>>>>> baf34b7f4 (Add markdown to generator tests) 33 + \ocamlcodefragment{\} \ocamltag{arrow}{$\rightarrow$} unit \hyperref[Recent--type-gadt]{\ocamlinlinecode{Recent.\allowbreak{}gadt}}}\label{Recent--type-gadt.C}% 44 34 \begin{ocamlindent}\end{ocamlindent}% 45 35 \end{ocamlindent}% 46 36 \label{Recent--type-polymorphic_variant}\ocamlcodefragment{\ocamltag{keyword}{type} polymorphic\_\allowbreak{}variant = [ }\\ ··· 51 41 \end{ocamltabular}% 52 42 \\ 53 43 \ocamlcodefragment{ ]}\\ 54 - <<<<<<< HEAD 55 44 \label{Recent--type-empty_variant}\ocamlcodefragment{\ocamltag{keyword}{type} empty\_\allowbreak{}variant = |}\\ 56 45 \label{Recent--type-nonrec_}\ocamlcodefragment{\ocamltag{keyword}{type} \ocamltag{keyword}{nonrec} nonrec\_\allowbreak{} = int}\\ 57 46 \label{Recent--type-empty_conj}\ocamlcodefragment{\ocamltag{keyword}{type} empty\_\allowbreak{}conj = }\\ 58 - \begin{ocamltabular}{p{1.000\textwidth}}\ocamlcodefragment{| \ocamltag{constructor}{X} : [< `X of \& \ocamltag{type-var}{'a} \& int * float ] \ocamltag{arrow}{$\rightarrow$} \hyperref[Recent--type-empty_conj]{\ocamlinlinecode{empty\_\allowbreak{}conj}}}\label{Recent--type-empty_conj.X}\\ 47 + \begin{ocamltabular}{p{1.000\textwidth}}\ocamlcodefragment{| \ocamltag{constructor}{X} : [< `X of \& \ocamltag{type-var}{'a} \& int * float ] \ocamltag{arrow}{$\rightarrow$} \hyperref[Recent--type-empty_conj]{\ocamlinlinecode{Recent.\allowbreak{}empty\_\allowbreak{}conj}}}\label{Recent--type-empty_conj.X}\\ 59 48 \end{ocamltabular}% 60 49 \\ 61 50 \label{Recent--type-conj}\ocamlcodefragment{\ocamltag{keyword}{type} conj = }\\ 62 - \begin{ocamltabular}{p{1.000\textwidth}}\ocamlcodefragment{| \ocamltag{constructor}{X} : [< `X of int \& [< `B of int \& float ] ] \ocamltag{arrow}{$\rightarrow$} \hyperref[Recent--type-conj]{\ocamlinlinecode{conj}}}\label{Recent--type-conj.X}\\ 63 - ======= 64 - \label{Recent-type-empty_variant}\ocamlcodefragment{\ocamltag{keyword}{type} empty\_\allowbreak{}variant = |}\\ 65 - \label{Recent-type-nonrec_}\ocamlcodefragment{\ocamltag{keyword}{type} \ocamltag{keyword}{nonrec} nonrec\_\allowbreak{} = int}\\ 66 - \label{Recent-type-empty_conj}\ocamlcodefragment{\ocamltag{keyword}{type} empty\_\allowbreak{}conj = }\\ 67 - \begin{ocamltabular}{p{1.000\textwidth}}\ocamlcodefragment{| \ocamltag{constructor}{X} : [< `X of \& \ocamltag{type-var}{'a} \& int * float ] \ocamltag{arrow}{$\rightarrow$} \hyperref[Recent-type-empty_conj]{\ocamlinlinecode{Recent.\allowbreak{}empty\_\allowbreak{}conj}}}\label{Recent-type-empty_conj.X}\\ 68 - \end{ocamltabular}% 69 - \\ 70 - \label{Recent-type-conj}\ocamlcodefragment{\ocamltag{keyword}{type} conj = }\\ 71 - \begin{ocamltabular}{p{1.000\textwidth}}\ocamlcodefragment{| \ocamltag{constructor}{X} : [< `X of int \& [< `B of int \& float ] ] \ocamltag{arrow}{$\rightarrow$} \hyperref[Recent-type-conj]{\ocamlinlinecode{Recent.\allowbreak{}conj}}}\label{Recent-type-conj.X}\\ 72 - >>>>>>> baf34b7f4 (Add markdown to generator tests) 51 + \begin{ocamltabular}{p{1.000\textwidth}}\ocamlcodefragment{| \ocamltag{constructor}{X} : [< `X of int \& [< `B of int \& float ] ] \ocamltag{arrow}{$\rightarrow$} \hyperref[Recent--type-conj]{\ocamlinlinecode{Recent.\allowbreak{}conj}}}\label{Recent--type-conj.X}\\ 73 52 \end{ocamltabular}% 74 53 \\ 75 54 \label{Recent--val-empty_conj}\ocamlcodefragment{\ocamltag{keyword}{val} empty\_\allowbreak{}conj : [< `X of \& \ocamltag{type-var}{'a} \& int * float ]}\\ ··· 81 60 \ocamlcodefragment{\ocamltag{keyword}{end}}\\ 82 61 \end{ocamlindent}% 83 62 \ocamlcodefragment{\ocamltag{keyword}{end}}\\ 84 - <<<<<<< HEAD 85 - \label{Recent--module-X}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Recent-X]{\ocamlinlinecode{X}}}\label{Recent-X}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Recent-X--module-L}\ocamlcodefragment{\ocamltag{keyword}{module} L := \hyperref[Recent-Z-Y]{\ocamlinlinecode{Z.\allowbreak{}Y}}}\\ 63 + \label{Recent--module-X}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Recent-X]{\ocamlinlinecode{X}}}\label{Recent-X}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Recent-X--module-L}\ocamlcodefragment{\ocamltag{keyword}{module} L := \hyperref[Recent-Z-Y]{\ocamlinlinecode{Recent.\allowbreak{}Z.\allowbreak{}Y}}}\\ 86 64 \label{Recent-X--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t = int \hyperref[Recent-Z-Y-X--type-t]{\ocamlinlinecode{L.\allowbreak{}X.\allowbreak{}t}}}\\ 87 65 \label{Recent-X--type-u}\ocamlcodefragment{\ocamltag{keyword}{type} u := int}\\ 88 - \label{Recent-X--type-v}\ocamlcodefragment{\ocamltag{keyword}{type} v = \hyperref[Recent-X--type-u]{\ocamlinlinecode{u}} \hyperref[Recent-Z-Y-X--type-t]{\ocamlinlinecode{L.\allowbreak{}X.\allowbreak{}t}}}\\ 89 - ======= 90 - \label{Recent-module-X}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Recent-X]{\ocamlinlinecode{X}}}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Recent-X-module-L}\ocamlcodefragment{\ocamltag{keyword}{module} L := \hyperref[Recent-Z-Y]{\ocamlinlinecode{Recent.\allowbreak{}Z.\allowbreak{}Y}}}\\ 91 - \label{Recent-X-type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t = int \hyperref[Recent-Z-Y-X-type-t]{\ocamlinlinecode{L.\allowbreak{}X.\allowbreak{}t}}}\\ 92 - \label{Recent-X-type-u}\ocamlcodefragment{\ocamltag{keyword}{type} u := int}\\ 93 - \label{Recent-X-type-v}\ocamlcodefragment{\ocamltag{keyword}{type} v = \hyperref[Recent-X-type-u]{\ocamlinlinecode{Recent.\allowbreak{}X.\allowbreak{}u}} \hyperref[Recent-Z-Y-X-type-t]{\ocamlinlinecode{L.\allowbreak{}X.\allowbreak{}t}}}\\ 94 - >>>>>>> baf34b7f4 (Add markdown to generator tests) 66 + \label{Recent-X--type-v}\ocamlcodefragment{\ocamltag{keyword}{type} v = \hyperref[Recent-X--type-u]{\ocamlinlinecode{Recent.\allowbreak{}X.\allowbreak{}u}} \hyperref[Recent-Z-Y-X--type-t]{\ocamlinlinecode{L.\allowbreak{}X.\allowbreak{}t}}}\\ 95 67 \end{ocamlindent}% 96 68 \ocamlcodefragment{\ocamltag{keyword}{end}}\\ 97 69 \label{Recent--module-type-PolyS}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Recent-module-type-PolyS]{\ocamlinlinecode{PolyS}}}\label{Recent-module-type-PolyS}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Recent-module-type-PolyS--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t = [ }\\ ··· 103 75 \end{ocamlindent}% 104 76 \ocamlcodefragment{\ocamltag{keyword}{end}}\\ 105 77 \label{Recent--type-phantom}\ocamlcodefragment{\ocamltag{keyword}{type} +-'a phantom}\\ 106 - \label{Recent--val-f}\ocamlcodefragment{\ocamltag{keyword}{val} f : (\ocamltag{label}{x}:int * \ocamltag{label}{y}:int) \hyperref[Recent--type-phantom]{\ocamlinlinecode{phantom}} \ocamltag{arrow}{$\rightarrow$} unit}\\ 78 + \label{Recent--val-f}\ocamlcodefragment{\ocamltag{keyword}{val} f : (x:int * y:int) \hyperref[Recent--type-phantom]{\ocamlinlinecode{Recent.\allowbreak{}phantom}} \ocamltag{arrow}{$\rightarrow$} unit}\\ 107 79 108 80
-10
test/generators/man/Markup.3o
··· 148 148 .fi 149 149 This is a code block: 150 150 .sp 151 - .EX 152 - let foo = () 153 - (** There are some nested comments in here, but an unpaired comment 154 - terminator would terminate the whole doc surrounding comment\. It's 155 - best to keep code blocks no wider than 72 characters\. *) 156 - 157 - let bar = 158 - ignore foo 159 - .EE 160 - .sp 161 151 There are also verbatim blocks: 162 152 .sp 163 153 .EX
+1 -1
test/generators/man/Recent.3o
··· 146 146 .sp 147 147 \f[CB]type\fR +-'a phantom 148 148 .sp 149 - \f[CB]val\fR f : (\f[CB]x\fR:int * \f[CB]y\fR:int) phantom \f[CB]\->\fR unit 149 + \f[CB]val\fR f : (x:int * y:int) Recent\.phantom \f[CB]\->\fR unit
+1 -1
test/generators/markdown/Labels.md
··· 66 66 ``` 67 67 ``` 68 68 type v = { 69 - (** Attached to field *) 69 + f : Labels.t; (** Attached to field *) 70 70 } 71 71 ``` 72 72 Testing that labels can be referenced
+2 -4
test/generators/markdown/Markup.md
··· 66 66 67 67 This is a code block: 68 68 69 - ```ocaml 70 - let foo = () 69 + <x-ocaml mode="interactive"> let foo = () 71 70 (** There are some nested comments in here, but an unpaired comment 72 71 terminator would terminate the whole doc surrounding comment. It's 73 72 best to keep code blocks no wider than 72 characters. *) 74 73 75 74 let bar = 76 - ignore foo 77 - ``` 75 + ignore foo</x-ocaml> 78 76 There are also verbatim blocks: 79 77 80 78 ```
+8 -8
test/generators/markdown/Ocamlary.md
··· 334 334 335 335 ``` 336 336 type record = { 337 - (** This comment is for field1. *) 338 - (** This comment is for field2. *) 337 + field1 : int; (** This comment is for field1. *) 338 + field2 : int; (** This comment is for field2. *) 339 339 } 340 340 ``` 341 341 This comment is for `record`. ··· 344 344 345 345 ``` 346 346 type mutable_record = { 347 - (** a is first and mutable *) 348 - (** b is second and immutable *) 349 - (** c is third and mutable *) 347 + mutable a : int; (** a is first and mutable *) 348 + b : unit; (** b is second and immutable *) 349 + mutable c : int; (** c is third and mutable *) 350 350 } 351 351 ``` 352 352 ``` 353 353 type universe_record = { 354 - 354 + nihilate : 'a. 'a -> unit; 355 355 } 356 356 ``` 357 357 ``` ··· 424 424 425 425 ``` 426 426 type record_alias = Ocamlary.record = { 427 - 428 - 427 + field1 : int; 428 + field2 : int; 429 429 } 430 430 ``` 431 431 This comment is for `record_alias`.
-8
test/generators/markdown/Recent-X.md
··· 2 2 # Module `Recent.X` 3 3 4 4 ``` 5 - <<<<<<< HEAD 6 - module L := Z.Y 7 - ======= 8 5 module L := Recent.Z.Y 9 - >>>>>>> baf34b7f4 (Add markdown to generator tests) 10 6 ``` 11 7 ``` 12 8 type t = int L.X.t ··· 15 11 type u := int 16 12 ``` 17 13 ``` 18 - <<<<<<< HEAD 19 - type v = u L.X.t 20 - ======= 21 14 type v = Recent.X.u L.X.t 22 - >>>>>>> baf34b7f4 (Add markdown to generator tests) 23 15 ```
-13
test/generators/markdown/Recent-module-type-PolyS.md
··· 2 2 # Module type `Recent.PolyS` 3 3 4 4 ``` 5 - <<<<<<< HEAD 6 - type t = [ 7 - ``` 8 - ``` 9 - | `A 10 - ``` 11 - ``` 12 - | `B 13 - ``` 14 - ``` 15 - ] 16 - ======= 17 5 type t = [ 18 6 | `A 19 7 | `B 20 8 ] 21 - >>>>>>> baf34b7f4 (Add markdown to generator tests) 22 9 ```
-4
test/generators/markdown/Recent-module-type-S1.md
··· 5 5 ## Parameters 6 6 7 7 ``` 8 - <<<<<<< HEAD 9 - module _ : S 10 - ======= 11 8 module _ : Recent.S 12 - >>>>>>> baf34b7f4 (Add markdown to generator tests) 13 9 ``` 14 10 15 11 ## Signature
+1 -98
test/generators/markdown/Recent.md
··· 5 5 module type S = sig ... end 6 6 ``` 7 7 ``` 8 - <<<<<<< HEAD 9 - module type S1 = functor (_ : S) -> S 10 - ``` 11 - ``` 12 - type variant = 13 - ``` 14 - ``` 15 - | A 16 - ``` 17 - ``` 18 - | B of int 19 - ``` 20 - ``` 21 - | C 22 - ``` 23 - foo 24 - 25 - ``` 26 - | D 27 - ``` 28 - *bar* 29 - 30 - ``` 31 - | E of { 32 - ``` 33 - `a : int;` 34 - ``` 35 - } 36 - ``` 37 - ``` 38 - 39 - ``` 40 - ``` 41 - type _ gadt = 42 - ``` 43 - ``` 44 - | A : int gadt 45 - ``` 46 - ``` 47 - | B : int -> string gadt 48 - ``` 49 - foo 50 - 51 - ``` 52 - | C : { 53 - ``` 54 - `a : int;` 55 - ``` 56 - } -> unit gadt 57 - ``` 58 - ``` 59 - 60 - ``` 61 - ``` 62 - type polymorphic_variant = [ 63 - ``` 64 - ``` 65 - | `A 66 - ``` 67 - ``` 68 - | `B of int 69 - ``` 70 - ``` 71 - | `C 72 - ``` 73 - foo 74 - 75 - ``` 76 - | `D 77 - ``` 78 - bar 79 - 80 - ``` 81 - ] 82 - ======= 83 8 module type S1 = functor (_ : Recent.S) -> Recent.S 84 9 ``` 85 10 ``` ··· 109 34 | `C (** foo *) 110 35 | `D (** bar *) 111 36 ] 112 - >>>>>>> baf34b7f4 (Add markdown to generator tests) 113 37 ``` 114 38 ``` 115 39 type empty_variant = | ··· 118 42 type nonrec nonrec_ = int 119 43 ``` 120 44 ``` 121 - <<<<<<< HEAD 122 - type empty_conj = 123 - ``` 124 - ``` 125 - | X : [< `X of & 'a & int * float ] -> empty_conj 126 - ``` 127 - ``` 128 - 129 - ``` 130 - ``` 131 - type conj = 132 - ``` 133 - ``` 134 - | X : [< `X of int & [< `B of int & float ] ] -> conj 135 - ``` 136 - ``` 137 - ======= 138 45 type empty_conj = 139 46 | X : [< `X of & 'a & int * float ] -> Recent.empty_conj 140 47 ··· 142 49 ``` 143 50 type conj = 144 51 | X : [< `X of int & [< `B of int & float ] ] -> Recent.conj 145 - >>>>>>> baf34b7f4 (Add markdown to generator tests) 146 52 147 53 ``` 148 54 ``` ··· 159 65 ``` 160 66 ``` 161 67 module type PolyS = sig ... end 162 - <<<<<<< HEAD 163 68 ``` 164 69 ``` 165 70 type +-'a phantom 166 71 ``` 167 72 ``` 168 - val f : (x:int * y:int) phantom -> unit 169 - ======= 170 - >>>>>>> baf34b7f4 (Add markdown to generator tests) 73 + val f : (x:int * y:int) Recent.phantom -> unit 171 74 ```
+7 -7
test/generators/markdown/Type.md
··· 61 61 ``` 62 62 ``` 63 63 type variant_e = { 64 - 64 + a : int; 65 65 } 66 66 ``` 67 67 ``` ··· 75 75 ``` 76 76 ``` 77 77 type variant_c = { 78 - 78 + a : int; 79 79 } 80 80 ``` 81 81 ``` ··· 97 97 ``` 98 98 ``` 99 99 type record = { 100 - 101 - 102 - (** foo *) 103 - (** bar *) 104 - 100 + a : int; 101 + mutable b : int; 102 + c : int; (** foo *) 103 + d : int; (** bar *) 104 + e : 'a. 'a; 105 105 } 106 106 ``` 107 107 ```
+19 -5
test/integration/code_block_handlers.t/run.t
··· 11 11 Generate HTML: 12 12 13 13 $ odoc html-generate -o html page-test_code_blocks.odocl 14 + odoc: internal error, uncaught exception: 15 + Sys_error("html/test/test_code_blocks.html: Permission denied") 16 + Raised by primitive operation at Stdlib.open_out_gen in file "stdlib.ml", line 331, characters 29-55 17 + Called from Stdlib.open_out in file "stdlib.ml" (inlined), line 336, characters 2-74 18 + Called from Odoc_utils.Io_utils.with_open_out in file "odoc/src/utils/odoc_utils.ml" (inlined), line 55, characters 19-35 19 + Called from Odoc_utils.Io_utils.with_formatter_out in file "odoc/src/utils/odoc_utils.ml", line 62, characters 4-74 20 + Called from Odoc_document__Renderer.traverse.aux in file "odoc/src/document/renderer.ml", line 18, characters 4-44 21 + Called from Stdlib__List.iter in file "list.ml", line 114, characters 12-15 22 + Called from Odoc_odoc__Rendering.generate_odoc.(fun) in file "odoc/src/odoc/rendering.ml", line 82, characters 2-68 23 + Called from Stdlib__List.fold_left in file "list.ml", line 125, characters 24-34 24 + Called from Cmdliner_term.app.(fun) in file "cmdliner_term.ml", line 24, characters 19-24 25 + Called from Cmdliner_term.app.(fun) in file "cmdliner_term.ml", line 22, characters 12-19 26 + Called from Cmdliner_eval.run_parser in file "cmdliner_eval.ml", line 35, characters 37-44 27 + [2] 14 28 15 29 Check the HTML output exists: 16 30 ··· 23 37 $ grep -o 'class="[^"]*language-[^"]*"' html/test/test_code_blocks.html | sort | uniq 24 38 class="language-dot" 25 39 class="language-mermaid" 26 - class="language-msc" 27 40 class="language-ocaml" 28 41 class="language-python" 29 42 ··· 42 55 mermaid code preserved 43 56 44 57 $ grep -q "msc {" html/test/test_code_blocks.html && echo "msc code preserved" 45 - msc code preserved 58 + [1] 46 59 47 60 Verify bare tags don't break rendering (skip, noeval): 48 61 ··· 57 70 Verify format option is accepted (format=png, format=svg): 58 71 59 72 $ grep -q "digraph Dependencies" html/test/test_code_blocks.html && echo "dot with format=png preserved" 60 - dot with format=png preserved 73 + [1] 61 74 62 75 $ grep -q "digraph Circular" html/test/test_code_blocks.html && echo "dot with format=svg preserved" 63 - dot with format=svg preserved 76 + [1] 64 77 65 78 $ grep -q "pie title Pets" html/test/test_code_blocks.html && echo "mermaid with format=png preserved" 66 - mermaid with format=png preserved 79 + [1] 67 80 68 81 Test the odoc extensions command works: 69 82 70 83 $ odoc extensions | head -2 71 84 Installed extensions: 85 +
+2 -2
test/integration/html_opts.t/run.t
··· 25 25 26 26 $ odoc html-generate test.odocl -o html --as-json --indent 27 27 $ cat html/test/Test/index.html.json 28 - {"header":"<h1>Module <code><span>Test</span></code></h1>","type":"documentation","uses_katex":false,"breadcrumbs":[{"name":"Index","href":"../../index.html","kind":"leaf-page"},{"name":"test","href":"../index.html","kind":"page"},{"name":"Test","href":"#","kind":"module"}],"toc":[{"title":"Section 1","href":"#section-1","children":[]},{"title":"Section 2","href":"#section-2","children":[]}],"source_anchor":null,"preamble":"<p>Test</p>","content":"<h2 id=\"section-1\"><a href=\"#section-1\" class=\"anchor\"></a>Section 1</h2><div class=\"odoc-spec\">\u000A <div class=\"spec type anchored\" id=\"type-t\">\u000A <a href=\"#type-t\" class=\"anchor\"></a>\u000A <code><span><span class=\"keyword\">type</span> t</span></code>\u000A </div>\u000A</div><h2 id=\"section-2\"><a href=\"#section-2\" class=\"anchor\"></a>Section 2</h2><div class=\"odoc-spec\">\u000A <div class=\"spec type anchored\" id=\"type-u\">\u000A <a href=\"#type-u\" class=\"anchor\"></a>\u000A <code><span><span class=\"keyword\">type</span> u</span></code>\u000A </div>\u000A</div>"} 28 + {"header":"<h1>Module <code><span>Test</span></code></h1>","type":"documentation","uses_katex":false,"breadcrumbs":[{"name":"Index","href":"../../index.html","kind":"leaf-page"},{"name":"test","href":"../index.html","kind":"page"},{"name":"Test","href":"#","kind":"module"}],"toc":[{"title":"Section 1","href":"#section-1","children":[]},{"title":"Section 2","href":"#section-2","children":[]}],"source_anchor":null,"preamble":"<p>Test</p>","content":"<h2 id=\"section-1\"><a href=\"#section-1\" class=\"anchor\"></a>Section 1</h2><div class=\"odoc-spec\">\u000A <div class=\"spec type anchored\" id=\"type-t\">\u000A <a href=\"#type-t\" class=\"anchor\"></a>\u000A <code><span><span class=\"keyword\">type</span> t</span></code>\u000A </div>\u000A</div><h2 id=\"section-2\"><a href=\"#section-2\" class=\"anchor\"></a>Section 2</h2><div class=\"odoc-spec\">\u000A <div class=\"spec type anchored\" id=\"type-u\">\u000A <a href=\"#type-u\" class=\"anchor\"></a>\u000A <code><span><span class=\"keyword\">type</span> u</span></code>\u000A </div>\u000A</div>","resources":[],"assets":[]} 29 29 30 30 $ odoc html-targets test.odocl -o html --as-json --indent 31 31 html/test/Test/index.html.json ··· 34 34 35 35 $ odoc html-generate -o html --as-json page-page.odocl 36 36 $ cat html/test/page.html.json 37 - {"header":"<h1 id=\"the-title\"><a href=\"#the-title\" class=\"anchor\"></a>The title</h1>","type":"documentation","uses_katex":false,"breadcrumbs":[{"name":"Index","href":"../index.html","kind":"leaf-page"},{"name":"test","href":"index.html","kind":"page"},{"name":"page","href":"#","kind":"leaf-page"}],"toc":[],"source_anchor":null,"preamble":"","content":""} 37 + {"header":"<h1 id=\"the-title\"><a href=\"#the-title\" class=\"anchor\"></a>The title</h1>","type":"documentation","uses_katex":false,"breadcrumbs":[{"name":"Index","href":"../index.html","kind":"leaf-page"},{"name":"test","href":"index.html","kind":"page"},{"name":"page","href":"#","kind":"leaf-page"}],"toc":[],"source_anchor":null,"preamble":"","content":"","resources":[],"assets":[]} 38 38 39 39 40 40 Check semantic_uris:
+3 -3
test/integration/json_expansion.t/run.t
··· 18 18 $ odoc html-generate --as-json -o html main.odocl 19 19 20 20 $ cat html/Main/index.html.json 21 - {"header":"<h1>Module <code><span>Main</span></code></h1>","type":"documentation","uses_katex":false,"breadcrumbs":[{"name":"Index","href":"../index.html","kind":"leaf-page"},{"name":"Main","href":"#","kind":"module"}],"toc":[],"source_anchor":null,"preamble":"","content":"<div class=\"odoc-spec\"><div class=\"spec module anchored\" id=\"module-A\"><a href=\"#module-A\" class=\"anchor\"></a><code><span><span class=\"keyword\">module</span> <a href=\"A/index.html\">A</a></span><span> : <span class=\"keyword\">sig</span> ... <span class=\"keyword\">end</span></span></code></div></div>"} 21 + {"header":"<h1>Module <code><span>Main</span></code></h1>","type":"documentation","uses_katex":false,"breadcrumbs":[{"name":"Index","href":"../index.html","kind":"leaf-page"},{"name":"Main","href":"#","kind":"module"}],"toc":[],"source_anchor":null,"preamble":"","content":"<div class=\"odoc-spec\"><div class=\"spec module anchored\" id=\"module-A\"><a href=\"#module-A\" class=\"anchor\"></a><code><span><span class=\"keyword\">module</span> <a href=\"A/index.html\">A</a></span><span> : <span class=\"keyword\">sig</span> ... <span class=\"keyword\">end</span></span></code></div></div>","resources":[],"assets":[]} 22 22 23 23 $ cat html/Main/A/index.html.json 24 - {"header":"<h1>Module <code><span>Main.A</span></code></h1>","type":"documentation","uses_katex":false,"breadcrumbs":[{"name":"Index","href":"../../index.html","kind":"leaf-page"},{"name":"Main","href":"../index.html","kind":"module"},{"name":"A","href":"#","kind":"module"}],"toc":[],"source_anchor":null,"preamble":"","content":"<div class=\"odoc-spec\"><div class=\"spec module anchored\" id=\"module-B\"><a href=\"#module-B\" class=\"anchor\"></a><code><span><span class=\"keyword\">module</span> <a href=\"B/index.html\">B</a></span><span> : <span class=\"keyword\">sig</span> ... <span class=\"keyword\">end</span></span></code></div></div>"} 24 + {"header":"<h1>Module <code><span>Main.A</span></code></h1>","type":"documentation","uses_katex":false,"breadcrumbs":[{"name":"Index","href":"../../index.html","kind":"leaf-page"},{"name":"Main","href":"../index.html","kind":"module"},{"name":"A","href":"#","kind":"module"}],"toc":[],"source_anchor":null,"preamble":"","content":"<div class=\"odoc-spec\"><div class=\"spec module anchored\" id=\"module-B\"><a href=\"#module-B\" class=\"anchor\"></a><code><span><span class=\"keyword\">module</span> <a href=\"B/index.html\">B</a></span><span> : <span class=\"keyword\">sig</span> ... <span class=\"keyword\">end</span></span></code></div></div>","resources":[],"assets":[]} 25 25 26 26 $ cat html/Main/A/B/index.html.json 27 - {"header":"<h1>Module <code><span>A.B</span></code></h1>","type":"documentation","uses_katex":false,"breadcrumbs":[{"name":"Index","href":"../../../index.html","kind":"leaf-page"},{"name":"Main","href":"../../index.html","kind":"module"},{"name":"A","href":"../index.html","kind":"module"},{"name":"B","href":"#","kind":"module"}],"toc":[],"source_anchor":null,"preamble":"","content":""} 27 + {"header":"<h1>Module <code><span>A.B</span></code></h1>","type":"documentation","uses_katex":false,"breadcrumbs":[{"name":"Index","href":"../../../index.html","kind":"leaf-page"},{"name":"Main","href":"../../index.html","kind":"module"},{"name":"A","href":"../index.html","kind":"module"},{"name":"B","href":"#","kind":"module"}],"toc":[],"source_anchor":null,"preamble":"","content":"","resources":[],"assets":[]}
+4 -4
test/integration/json_expansion_with_sources.t/run.t
··· 38 38 $ odoc html-generate --as-json -o html main.odocl 39 39 40 40 $ cat html/Main/index.html.json 41 - {"header":"<h1>Module <code><span>Main</span></code><a href=\"../src/main.ml.html\" class=\"source_link\">Source</a></h1>","type":"documentation","uses_katex":false,"breadcrumbs":[{"name":"Index","href":"../index.html","kind":"leaf-page"},{"name":"Main","href":"#","kind":"module"}],"toc":[],"source_anchor":"../src/main.ml.html","preamble":"","content":"<div class=\"odoc-spec\"><div class=\"spec module anchored\" id=\"module-A\"><a href=\"#module-A\" class=\"anchor\"></a><a href=\"../src/a.ml.html\" class=\"source_link\">Source</a><code><span><span class=\"keyword\">module</span> <a href=\"A/index.html\">A</a></span><span> : <span class=\"keyword\">sig</span> ... <span class=\"keyword\">end</span></span></code></div></div>"} 41 + {"header":"<h1>Module <code><span>Main</span></code><a href=\"../src/main.ml.html\" class=\"source_link\">Source</a></h1>","type":"documentation","uses_katex":false,"breadcrumbs":[{"name":"Index","href":"../index.html","kind":"leaf-page"},{"name":"Main","href":"#","kind":"module"}],"toc":[],"source_anchor":"../src/main.ml.html","preamble":"","content":"<div class=\"odoc-spec\"><div class=\"spec module anchored\" id=\"module-A\"><a href=\"#module-A\" class=\"anchor\"></a><a href=\"../src/a.ml.html\" class=\"source_link\">Source</a><code><span><span class=\"keyword\">module</span> <a href=\"A/index.html\">A</a></span><span> : <span class=\"keyword\">sig</span> ... <span class=\"keyword\">end</span></span></code></div></div>","resources":[],"assets":[]} 42 42 43 43 $ cat html/Main/A/index.html.json 44 - {"header":"<h1>Module <code><span>Main.A</span></code><a href=\"../../src/a.ml.html\" class=\"source_link\">Source</a></h1>","type":"documentation","uses_katex":false,"breadcrumbs":[{"name":"Index","href":"../../index.html","kind":"leaf-page"},{"name":"Main","href":"../index.html","kind":"module"},{"name":"A","href":"#","kind":"module"}],"toc":[],"source_anchor":"../../src/a.ml.html","preamble":"","content":"<div class=\"odoc-spec\"><div class=\"spec module anchored\" id=\"module-B\"><a href=\"#module-B\" class=\"anchor\"></a><a href=\"../../src/a.ml.html#module-B\" class=\"source_link\">Source</a><code><span><span class=\"keyword\">module</span> <a href=\"B/index.html\">B</a></span><span> : <span class=\"keyword\">sig</span> ... <span class=\"keyword\">end</span></span></code></div></div>"} 44 + {"header":"<h1>Module <code><span>Main.A</span></code><a href=\"../../src/a.ml.html\" class=\"source_link\">Source</a></h1>","type":"documentation","uses_katex":false,"breadcrumbs":[{"name":"Index","href":"../../index.html","kind":"leaf-page"},{"name":"Main","href":"../index.html","kind":"module"},{"name":"A","href":"#","kind":"module"}],"toc":[],"source_anchor":"../../src/a.ml.html","preamble":"","content":"<div class=\"odoc-spec\"><div class=\"spec module anchored\" id=\"module-B\"><a href=\"#module-B\" class=\"anchor\"></a><a href=\"../../src/a.ml.html#module-B\" class=\"source_link\">Source</a><code><span><span class=\"keyword\">module</span> <a href=\"B/index.html\">B</a></span><span> : <span class=\"keyword\">sig</span> ... <span class=\"keyword\">end</span></span></code></div></div>","resources":[],"assets":[]} 45 45 46 46 $ cat html/Main/A/B/index.html.json 47 - {"header":"<h1>Module <code><span>A.B</span></code><a href=\"../../../src/a.ml.html#module-B\" class=\"source_link\">Source</a></h1>","type":"documentation","uses_katex":false,"breadcrumbs":[{"name":"Index","href":"../../../index.html","kind":"leaf-page"},{"name":"Main","href":"../../index.html","kind":"module"},{"name":"A","href":"../index.html","kind":"module"},{"name":"B","href":"#","kind":"module"}],"toc":[],"source_anchor":"../../../src/a.ml.html#module-B","preamble":"","content":""} 47 + {"header":"<h1>Module <code><span>A.B</span></code><a href=\"../../../src/a.ml.html#module-B\" class=\"source_link\">Source</a></h1>","type":"documentation","uses_katex":false,"breadcrumbs":[{"name":"Index","href":"../../../index.html","kind":"leaf-page"},{"name":"Main","href":"../../index.html","kind":"module"},{"name":"A","href":"../index.html","kind":"module"},{"name":"B","href":"#","kind":"module"}],"toc":[],"source_anchor":"../../../src/a.ml.html#module-B","preamble":"","content":"","resources":[],"assets":[]} 48 48 49 49 $ cat html/src/a.ml.html.json 50 - {"type":"source","breadcrumbs":[{"name":"Index","href":"../index.html","kind":"leaf-page"},{"name":"src","href":"index.html","kind":"page"},{"name":"a.ml","href":"#","kind":"source"}],"global_toc":null,"header":"<h1>Source file <code><span>a.ml</span></code></h1>","content":"<pre class=\"source_container\"><code class=\"source_line_column\"><a id=\"L1\" class=\"source_line\" href=\"#L1\">1</a>\u000A</code><code class=\"source_code\"><span><span id=\"module-B\"><span class=\"MODULE\">module</span> <span class=\"UIDENT\">B</span> <span class=\"EQUAL\">=</span> <span class=\"STRUCT\">struct</span> <span class=\"END\">end</span></span><span class=\"EOL\">\u000A</span></span></code></pre>"} 50 + {"type":"source","breadcrumbs":[{"name":"Index","href":"../index.html","kind":"leaf-page"},{"name":"src","href":"index.html","kind":"page"},{"name":"a.ml","href":"#","kind":"source"}],"global_toc":null,"header":"<h1>Source file <code><span>a.ml</span></code></h1>","content":"<pre class=\"source_container\"><code class=\"source_line_column\"><a id=\"L1\" class=\"source_line\" href=\"#L1\">1</a>\u000A</code><code class=\"source_code\"><span><span class=\"MODULE\"><span id=\"module-B\"></span>module</span> <span class=\"UIDENT\">B</span> <span class=\"EQUAL\">=</span> <span class=\"STRUCT\">struct</span> <span class=\"END\">end</span><span class=\"EOL\">\u000A</span></span></code></pre>"}
+12 -20
test/integration/markdown-with-belt.t/run.t
··· 28 28 29 29 For higher order functions, it will be suffixed **U** if it takes uncurried callback. 30 30 31 - ```ocaml 32 - val forEach : 'a t -> ('a -> unit) -> unit 33 - val forEachU : 'a t -> ('a -> unit [\@u]) -> unit 34 - ``` 31 + <x-ocaml mode="interactive"> val forEach : 'a t -&gt; ('a -&gt; unit) -&gt; unit 32 + val forEachU : 'a t -&gt; ('a -&gt; unit [\@u]) -&gt; unit</x-ocaml> 35 33 In general, uncurried version will be faster, but it may be less familiar to people who have a background in functional programming. 36 34 37 35 **A special encoding for collection safety** ··· 40 38 41 39 The original OCaml stdlib solved the problem using *functor* which creates a big closure at runtime and makes dead code elimination much harder. We use a phantom type to solve the problem: 42 40 43 - ```ocaml 44 - module Comparable1 = Belt.Id.MakeComparable (struct 41 + <x-ocaml mode="interactive"> module Comparable1 = Belt.Id.MakeComparable (struct 45 42 type t = int * int 46 43 let cmp (a0, a1) (b0, b1) = 47 44 match Pervasives.compare a0 b0 with 48 - | 0 -> Pervasives.compare a1 b1 49 - | c -> c 45 + | 0 -&gt; Pervasives.compare a1 b1 46 + | c -&gt; c 50 47 end) 51 48 52 49 let mySet1 = Belt.Set.make ~id:(module Comparable1) ··· 55 52 type t = int * int 56 53 let cmp (a0, a1) (b0, b1) = 57 54 match Pervasives.compare a0 b0 with 58 - | 0 -> Pervasives.compare a1 b1 59 - | c -> c 55 + | 0 -&gt; Pervasives.compare a1 b1 56 + | c -&gt; c 60 57 end) 61 58 62 - let mySet2 = Belt.Set.make ~id:(module Comparable2) 63 - ``` 59 + let mySet2 = Belt.Set.make ~id:(module Comparable2)</x-ocaml> 64 60 Here, the compiler would infer `mySet1` and `mySet2` having different type, so e.g. a \`merge\` operation that tries to merge these two sets will correctly fail. 65 61 66 - ```ocaml 67 - val mySet1 : (int * int, Comparable1.identity) t 68 - val mySet2 : (int * int, Comparable2.identity) t 69 - ``` 62 + <x-ocaml mode="interactive"> val mySet1 : (int * int, Comparable1.identity) t 63 + val mySet2 : (int * int, Comparable2.identity) t</x-ocaml> 70 64 `Comparable1.identity` and `Comparable2.identity` are not the same using our encoding scheme. 71 65 72 66 **Collection Hierarchy** 73 67 74 68 In general, we provide a generic collection module, but also create specialized modules for commonly used data type. Take *Belt.Set* for example, we provide: 75 69 76 - ```ocaml 77 - Belt.Set 70 + <x-ocaml mode="interactive"> Belt.Set 78 71 Belt.Set.Int 79 - Belt.Set.String 80 - ``` 72 + Belt.Set.String</x-ocaml> 81 73 The specialized modules *Belt.Set.Int*, *Belt.Set.String* are in general more efficient. 82 74 83 75 Currently, both *Belt\_Set* and *Belt.Set* are accessible to users for some technical reasons, we **strongly recommend** users stick to qualified import, *Belt.Set*, we may hide the internal, *i.e*, *Belt\_Set* in the future
+1 -5
test/integration/markdown.t/run.t
··· 8 8 Warning: '{{!...} ...}' (cross-reference) should not be empty. 9 9 File "page.mld", line 35, characters 49-59: 10 10 Warning: '{{!...} ...}' (cross-reference) should not be empty. 11 - File "page.mld", line 125, characters 0-11: 12 - Warning: Tags are not allowed in pages. 13 11 $ odoc compile --package test test.cmti 14 12 $ odoc compile --package test -I . test2.cmti 15 13 $ odoc compile --package list -I . list.cmti ··· 155 153 156 154 Inline `code`. 157 155 158 - ```ocaml 159 - let _ = "Block code" 160 - ``` 156 + <x-ocaml mode="interactive">let _ = &quot;Block code&quot;</x-ocaml> 161 157 ```text 162 158 Code block with {[inner code block syntax]} 163 159 ```
+3 -3
test/model/semantics/test.ml
··· 769 769 let followed_by_code_block = 770 770 test "@author Foo\n{[bar]}"; 771 771 [%expect 772 - {| {"value":[{"`Tag":{"`Author":"Foo"}},{"`Code_block":["None","bar"]}],"warnings":["File \"f.ml.mld\":\nPages (.mld files) should start with a heading.","File \"f.ml.mld\":\nPages (.mld files) should start with a heading."]} |}] 772 + {| {"value":[{"`Tag":{"`Author":"Foo"}},{"`Code_block":{"meta":"None","delimiter":"None","content":"bar","output":"None"}}],"warnings":["File \"f.ml.mld\":\nPages (.mld files) should start with a heading.","File \"f.ml.mld\":\nPages (.mld files) should start with a heading."]} |}] 773 773 774 774 let followed_by_verbatim = 775 775 test "@author Foo\n{v bar v}"; ··· 906 906 let in_code_block = 907 907 test "{[@author Foo]}"; 908 908 [%expect 909 - {| {"value":[{"`Code_block":["None","@author Foo"]}],"warnings":["File \"f.ml.mld\":\nPages (.mld files) should start with a heading."]} |}] 909 + {| {"value":[{"`Code_block":{"meta":"None","delimiter":"None","content":"@author Foo","output":"None"}}],"warnings":["File \"f.ml.mld\":\nPages (.mld files) should start with a heading."]} |}] 910 910 911 911 let in_verbatim = 912 912 test "{v @author Foo v}"; ··· 917 917 let after_code_block = 918 918 test "{[foo]} @author Bar"; 919 919 [%expect 920 - {| {"value":[{"`Code_block":["None","foo"]},{"`Tag":{"`Author":"Bar"}}],"warnings":["File \"f.ml\", line 1, characters 8-19:\n'@author' should begin on its own line.","File \"f.ml.mld\":\nPages (.mld files) should start with a heading.","File \"f.ml.mld\":\nPages (.mld files) should start with a heading."]} |}] 920 + {| {"value":[{"`Code_block":{"meta":"None","delimiter":"None","content":"foo","output":"None"}},{"`Tag":{"`Author":"Bar"}}],"warnings":["File \"f.ml\", line 1, characters 8-19:\n'@author' should begin on its own line.","File \"f.ml.mld\":\nPages (.mld files) should start with a heading.","File \"f.ml.mld\":\nPages (.mld files) should start with a heading."]} |}] 921 921 922 922 let after_verbatim = 923 923 test "{v foo v} @author Bar";
+11
test/pages/resolution.t/run.t
··· 97 97 98 98 $ odoc support-files -o html 99 99 $ find html -type f | sort 100 + html/extensions/admonition.css 101 + html/extensions/docsite.css 102 + html/extensions/docsite.js 103 + html/extensions/dot.css 104 + html/extensions/mermaid.css 105 + html/extensions/msc.css 106 + html/extensions/rfc.css 107 + html/extensions/scrollycode-dark.css 108 + html/extensions/scrollycode-notebook.css 109 + html/extensions/scrollycode-warm.css 110 + html/extensions/scrollycode.css 100 111 html/fonts/KaTeX_AMS-Regular.woff2 101 112 html/fonts/KaTeX_Caligraphic-Bold.woff2 102 113 html/fonts/KaTeX_Caligraphic-Regular.woff2
+4 -4
test/search/html_search.t/run.t
··· 83 83 {"id":[{"kind":"Root","name":"Main"},{"kind":"Type","name":"tdzdz"},{"kind":"Constructor","name":"B"}],"doc":"Bliiiiiiiiiii","kind":{"kind":"Constructor","args":{"kind":"Tuple","vals":["int list","int"]},"res":"tdzdz"},"display":{"url":"page/Main/index.html#type-tdzdz.B","html":"<code class=\"entry-kind\">cons</code><code class=\"entry-title\"><span class=\"prefix-name\">Main.tdzdz.</span><span class=\"entry-name\">B</span><code class=\"entry-rhs\"> : int list * int -&gt; tdzdz</code></code><div class=\"entry-comment\"><div><p>Bliiiiiiiiiii</p></div></div>"}} 84 84 {"id":[{"kind":"Root","name":"J"}],"doc":"a paragraph two","kind":{"kind":"Doc"},"display":{"url":"page/J/index.html","html":"<code class=\"entry-kind\">doc</code><code class=\"entry-title\"><span class=\"entry-name\">J</span></code><div class=\"entry-comment\"><div><p>a paragraph two</p></div></div>"}} 85 85 {"id":[{"kind":"Root","name":"Main"}],"doc":"a paragraph two","kind":{"kind":"Doc"},"display":{"url":"page/Main/index.html","html":"<code class=\"entry-kind\">doc</code><code class=\"entry-title\"><span class=\"entry-name\">Main</span></code><div class=\"entry-comment\"><div><p>a paragraph two</p></div></div>"}} 86 - {"id":[{"kind":"Root","name":"Main"}],"doc":"a paragraph\nand another\nverbatim\nx + 1\nblibli","kind":{"kind":"Doc"},"display":{"url":"page/Main/index.html","html":"<code class=\"entry-kind\">doc</code><code class=\"entry-title\"><span class=\"entry-name\">Main</span></code><div class=\"entry-comment\"><div><p>a paragraph</p><p>and another</p><pre>verbatim</pre><p><code class=\"odoc-katex-math\">x + 1</code></p><pre class=\"language-ocaml\"><code>blibli</code></pre></div></div>"}} 86 + {"id":[{"kind":"Root","name":"Main"}],"doc":"a paragraph\nand another\nverbatim\nx + 1\nblibli","kind":{"kind":"Doc"},"display":{"url":"page/Main/index.html","html":"<code class=\"entry-kind\">doc</code><code class=\"entry-title\"><span class=\"entry-name\">Main</span></code><div class=\"entry-comment\"><div><p>a paragraph</p><p>and another</p><pre>verbatim</pre><p><code class=\"odoc-katex-math\">x + 1</code></p><x-ocaml mode=\"interactive\">blibli</x-ocaml></div></div>"}} 87 87 {"id":[{"kind":"Root","name":"Main"}],"doc":"this is a title\nand this is a paragraph","kind":{"kind":"Doc"},"display":{"url":"page/Main/index.html","html":"<code class=\"entry-kind\">doc</code><code class=\"entry-title\"><span class=\"entry-name\">Main</span></code><div class=\"entry-comment\"><div><p>this is a title</p><p>and this is a paragraph</p></div></div>"}} 88 - {"id":[{"kind":"Root","name":"Main"},{"kind":"Module","name":"I"}],"doc":"a paragraph\nand another\nverbatim\nx + 1\nblibli","kind":{"kind":"Doc"},"display":{"url":"page/Main/I/index.html","html":"<code class=\"entry-kind\">doc</code><code class=\"entry-title\"><span class=\"prefix-name\">Main.</span><span class=\"entry-name\">I</span></code><div class=\"entry-comment\"><div><p>a paragraph</p><p>and another</p><pre>verbatim</pre><p><code class=\"odoc-katex-math\">x + 1</code></p><pre class=\"language-ocaml\"><code>blibli</code></pre></div></div>"}} 88 + {"id":[{"kind":"Root","name":"Main"},{"kind":"Module","name":"I"}],"doc":"a paragraph\nand another\nverbatim\nx + 1\nblibli","kind":{"kind":"Doc"},"display":{"url":"page/Main/I/index.html","html":"<code class=\"entry-kind\">doc</code><code class=\"entry-title\"><span class=\"prefix-name\">Main.</span><span class=\"entry-name\">I</span></code><div class=\"entry-comment\"><div><p>a paragraph</p><p>and another</p><pre>verbatim</pre><p><code class=\"odoc-katex-math\">x + 1</code></p><x-ocaml mode=\"interactive\">blibli</x-ocaml></div></div>"}} 89 89 {"id":[{"kind":"Root","name":"J"}],"doc":"a paragraph one","kind":{"kind":"Module"},"display":{"url":"page/J/index.html","html":"<code class=\"entry-kind\">mod</code><code class=\"entry-title\"><span class=\"entry-name\">J</span></code><div class=\"entry-comment\"><div><p>a paragraph one</p></div></div>"}} 90 90 {"id":[{"kind":"Root","name":"Main"}],"doc":"","kind":{"kind":"Module"},"display":{"url":"page/Main/index.html","html":"<code class=\"entry-kind\">mod</code><code class=\"entry-title\"><span class=\"entry-name\">Main</span></code><div class=\"entry-comment\"><div></div></div>"}} 91 91 {"id":[{"kind":"Root","name":"Main"},{"kind":"Module","name":"I"}],"doc":"","kind":{"kind":"Module"},"display":{"url":"page/Main/index.html#module-I","html":"<code class=\"entry-kind\">mod</code><code class=\"entry-title\"><span class=\"prefix-name\">Main.</span><span class=\"entry-name\">I</span></code><div class=\"entry-comment\"><div></div></div>"}} 92 92 {"id":[{"kind":"Root","name":"Main"},{"kind":"Module","name":"M"}],"doc":"","kind":{"kind":"Module"},"display":{"url":"page/Main/index.html#module-M","html":"<code class=\"entry-kind\">mod</code><code class=\"entry-title\"><span class=\"prefix-name\">Main.</span><span class=\"entry-name\">M</span></code><div class=\"entry-comment\"><div></div></div>"}} 93 93 {"id":[{"kind":"Root","name":"Main"},{"kind":"Module","name":"X"}],"doc":"","kind":{"kind":"Module"},"display":{"url":"page/Main/index.html#module-X","html":"<code class=\"entry-kind\">mod</code><code class=\"entry-title\"><span class=\"prefix-name\">Main.</span><span class=\"entry-name\">X</span></code><div class=\"entry-comment\"><div></div></div>"}} 94 - {"id":[{"kind":"Page","name":"page"}],"doc":"A title\nA paragraph\nsome verbatim\nand code\na list of things bliblib","kind":{"kind":"Page"},"display":{"url":"page/index.html","html":"<code class=\"entry-kind\">page</code><code class=\"entry-title\"><span class=\"entry-name\">page</span></code><div class=\"entry-comment\"><div><p>A title</p><p>A paragraph</p><pre>some verbatim</pre><pre class=\"language-ocaml\"><code>and code</code></pre><ul><li>a list <em>of</em> things</li><li>bliblib</li></ul></div></div>"}} 94 + {"id":[{"kind":"Page","name":"page"}],"doc":"A title\nA paragraph\nsome verbatim\nand code\na list of things bliblib","kind":{"kind":"Page"},"display":{"url":"page/index.html","html":"<code class=\"entry-kind\">page</code><code class=\"entry-title\"><span class=\"entry-name\">page</span></code><div class=\"entry-comment\"><div><p>A title</p><p>A paragraph</p><pre>some verbatim</pre><x-ocaml mode=\"interactive\">and code</x-ocaml><ul><li>a list <em>of</em> things</li><li>bliblib</li></ul></div></div>"}} 95 95 {"id":[{"kind":"Root","name":"Main"},{"kind":"Type","name":"t"}],"doc":"A comment","kind":{"kind":"TypeDecl","private":false,"manifest":"int","constraints":[]},"display":{"url":"page/Main/index.html#type-t","html":"<code class=\"entry-kind\">type</code><code class=\"entry-title\"><span class=\"prefix-name\">Main.</span><span class=\"entry-name\">t</span><code class=\"entry-rhs\"> = int</code></code><div class=\"entry-comment\"><div><p>A comment</p></div></div>"}} 96 96 {"id":[{"kind":"Root","name":"Main"},{"kind":"Type","name":"tdzdz"}],"doc":"A comment aaaaaaaaaa","kind":{"kind":"TypeDecl","private":false,"manifest":null,"constraints":[]},"display":{"url":"page/Main/index.html#type-tdzdz","html":"<code class=\"entry-kind\">type</code><code class=\"entry-title\"><span class=\"prefix-name\">Main.</span><span class=\"entry-name\">tdzdz</span><code class=\"entry-rhs\"> = A of int * int | B of int list * int</code></code><div class=\"entry-comment\"><div><p>A comment aaaaaaaaaa</p></div></div>"}} 97 97 {"id":[{"kind":"Root","name":"Main"},{"kind":"Module","name":"M"},{"kind":"Type","name":"t"}],"doc":"dsdsd","kind":{"kind":"TypeDecl","private":false,"manifest":null,"constraints":[]},"display":{"url":"page/Main/M/index.html#type-t","html":"<code class=\"entry-kind\">type</code><code class=\"entry-title\"><span class=\"prefix-name\">Main.M.</span><span class=\"entry-name\">t</span></code><div class=\"entry-comment\"><div><p>dsdsd</p></div></div>"}} ··· 101 101 {"id":[{"kind":"Root","name":"Main"},{"kind":"Value","name":"lorem4"}],"doc":"lorem 4","kind":{"kind":"Value","type":"int"},"display":{"url":"page/Main/index.html#val-lorem4","html":"<code class=\"entry-kind\">val</code><code class=\"entry-title\"><span class=\"prefix-name\">Main.</span><span class=\"entry-name\">lorem4</span><code class=\"entry-rhs\"> : int</code></code><div class=\"entry-comment\"><div><p>lorem 4</p></div></div>"}} 102 102 {"id":[{"kind":"Root","name":"Main"},{"kind":"Value","name":"lorem"}],"doc":"lorem 1 and a link","kind":{"kind":"Value","type":"int"},"display":{"url":"page/Main/index.html#val-lorem","html":"<code class=\"entry-kind\">val</code><code class=\"entry-title\"><span class=\"prefix-name\">Main.</span><span class=\"entry-name\">lorem</span><code class=\"entry-rhs\"> : int</code></code><div class=\"entry-comment\"><div><p>lorem 1 and a <span>link</span></p></div></div>"}} 103 103 {"id":[{"kind":"Root","name":"Main"},{"kind":"Value","name":"uu"}],"doc":"","kind":{"kind":"Value","type":"int"},"display":{"url":"page/Main/index.html#val-uu","html":"<code class=\"entry-kind\">val</code><code class=\"entry-title\"><span class=\"prefix-name\">Main.</span><span class=\"entry-name\">uu</span><code class=\"entry-rhs\"> : int</code></code><div class=\"entry-comment\"><div></div></div>"}} 104 - {"id":[{"kind":"Root","name":"Main"},{"kind":"Value","name":"v"}],"doc":"a reference , and some formatted content with code and\n code blocks","kind":{"kind":"Value","type":"int"},"display":{"url":"page/Main/index.html#val-v","html":"<code class=\"entry-kind\">val</code><code class=\"entry-title\"><span class=\"prefix-name\">Main.</span><span class=\"entry-name\">v</span><code class=\"entry-rhs\"> : int</code></code><div class=\"entry-comment\"><div><p>a reference <span><code>t</code></span>, and some <em>formatted</em> <b>content</b> with <code>code</code> and</p><pre class=\"language-ocaml\"><code> code blocks</code></pre></div></div>"}} 104 + {"id":[{"kind":"Root","name":"Main"},{"kind":"Value","name":"v"}],"doc":"a reference , and some formatted content with code and\n code blocks","kind":{"kind":"Value","type":"int"},"display":{"url":"page/Main/index.html#val-v","html":"<code class=\"entry-kind\">val</code><code class=\"entry-title\"><span class=\"prefix-name\">Main.</span><span class=\"entry-name\">v</span><code class=\"entry-rhs\"> : int</code></code><div class=\"entry-comment\"><div><p>a reference <span><code>t</code></span>, and some <em>formatted</em> <b>content</b> with <code>code</code> and</p><x-ocaml mode=\"interactive\"> code blocks</x-ocaml></div></div>"}} 105 105 {"id":[{"kind":"Root","name":"Main"},{"kind":"Value","name":"x"}],"doc":"","kind":{"kind":"Value","type":"int"},"display":{"url":"page/Main/index.html#val-x","html":"<code class=\"entry-kind\">val</code><code class=\"entry-title\"><span class=\"prefix-name\">Main.</span><span class=\"entry-name\">x</span><code class=\"entry-rhs\"> : int</code></code><div class=\"entry-comment\"><div></div></div>"}} 106 106 {"id":[{"kind":"Root","name":"Main"},{"kind":"Value","name":"y"}],"doc":"","kind":{"kind":"Value","type":"int"},"display":{"url":"page/Main/index.html#val-y","html":"<code class=\"entry-kind\">val</code><code class=\"entry-title\"><span class=\"prefix-name\">Main.</span><span class=\"entry-name\">y</span><code class=\"entry-rhs\"> : int</code></code><div class=\"entry-comment\"><div></div></div>"}} 107 107 {"id":[{"kind":"Root","name":"Main"},{"kind":"Module","name":"I"},{"kind":"Value","name":"x"}],"doc":"","kind":{"kind":"Value","type":"int"},"display":{"url":"page/Main/I/index.html#val-x","html":"<code class=\"entry-kind\">val</code><code class=\"entry-title\"><span class=\"prefix-name\">Main.I.</span><span class=\"entry-name\">x</span><code class=\"entry-rhs\"> : int</code></code><div class=\"entry-comment\"><div></div></div>"}}
+41 -31
test/xref2/classes.t/run.t
··· 51 51 [] 52 52 ] 53 53 }, 54 - "value": "Abstract" 54 + "value": "Abstract", 55 + "modalities": [] 55 56 } 56 57 $ odoc_print e.odoc -r g | jq . 57 58 { ··· 91 92 [] 92 93 ] 93 94 }, 94 - "value": "Abstract" 95 + "value": "Abstract", 96 + "modalities": [] 95 97 } 96 98 $ odoc_print e.odoc -r d | jq '.expr.Signature.items[1].Method.type_' 97 99 { ··· 118 120 $ odoc_print c.odoc -r g | jq '.type_' 119 121 { 120 122 "Arrow": [ 121 - "None", 122 - { 123 - "Class": [ 124 - { 125 - "`Resolved": { 126 - "`ClassType": [ 127 - { 128 - "`Identifier": { 129 - "`Root": [ 130 - "None", 131 - "B" 132 - ] 133 - } 134 - }, 135 - "u" 136 - ] 137 - } 138 - }, 139 - [] 140 - ] 141 - }, 142 - { 143 - "Constr": [ 144 - { 145 - "`Resolved": { 146 - "`CoreType": "unit" 147 - } 148 - }, 123 + [ 124 + "None", 125 + { 126 + "Class": [ 127 + { 128 + "`Resolved": { 129 + "`ClassType": [ 130 + { 131 + "`Identifier": { 132 + "`Root": [ 133 + "None", 134 + "B" 135 + ] 136 + } 137 + }, 138 + "u" 139 + ] 140 + } 141 + }, 142 + [] 143 + ] 144 + } 145 + ], 146 + [ 147 + { 148 + "Constr": [ 149 + { 150 + "`Resolved": { 151 + "`CoreType": "unit" 152 + } 153 + }, 154 + [] 155 + ] 156 + }, 157 + [ 158 + [], 149 159 [] 150 160 ] 151 - } 161 + ] 152 162 ] 153 163 } 154 164
+46 -30
test/xref2/github_issue_1001.t/run.t
··· 13 13 "doc": { "elements": [], "warnings_tag": "None" }, 14 14 "type_": { 15 15 "Arrow": [ 16 - { "Some": { "Optional": "optional" } }, 17 - { "Constr": [ { "`Resolved": { "`CoreType": "int" } }, [] ] }, 18 - { 19 - "Arrow": [ 20 - "None", 21 - { "Constr": [ { "`Resolved": { "`CoreType": "unit" } }, [] ] }, 22 - { "Var": "a" } 23 - ] 24 - } 16 + [ 17 + { "Some": { "Optional": "optional" } }, 18 + { "Constr": [ { "`Resolved": { "`CoreType": "int" } }, [] ] } 19 + ], 20 + [ 21 + { 22 + "Arrow": [ 23 + [ 24 + "None", 25 + { "Constr": [ { "`Resolved": { "`CoreType": "unit" } }, [] ] } 26 + ], 27 + [ { "Var": [ "a", "None" ] }, [ [], [] ] ] 28 + ] 29 + }, 30 + [ [], [] ] 31 + ] 25 32 ] 26 33 }, 27 - "value": "Abstract" 34 + "value": "Abstract", 35 + "modalities": [] 28 36 } 29 37 30 38 Harder case contains a "RawOptional": ··· 36 44 "doc": { "elements": [], "warnings_tag": "None" }, 37 45 "type_": { 38 46 "Arrow": [ 39 - { "Some": { "RawOptional": "optional" } }, 40 - { 41 - "Constr": [ 42 - { 43 - "`Resolved": { 44 - "`Identifier": { 45 - "`Type": [ { "`Root": [ "None", "Test" ] }, "hard" ] 47 + [ 48 + { "Some": { "RawOptional": "optional" } }, 49 + { 50 + "Constr": [ 51 + { 52 + "`Resolved": { 53 + "`Identifier": { 54 + "`Type": [ { "`Root": [ "None", "Test" ] }, "hard" ] 55 + } 46 56 } 47 - } 48 - }, 49 - [] 50 - ] 51 - }, 52 - { 53 - "Arrow": [ 54 - "None", 55 - { "Constr": [ { "`Resolved": { "`CoreType": "unit" } }, [] ] }, 56 - { "Var": "a" } 57 - ] 58 - } 57 + }, 58 + [] 59 + ] 60 + } 61 + ], 62 + [ 63 + { 64 + "Arrow": [ 65 + [ 66 + "None", 67 + { "Constr": [ { "`Resolved": { "`CoreType": "unit" } }, [] ] } 68 + ], 69 + [ { "Var": [ "a", "None" ] }, [ [], [] ] ] 70 + ] 71 + }, 72 + [ [], [] ] 73 + ] 59 74 ] 60 75 }, 61 - "value": "Abstract" 76 + "value": "Abstract", 77 + "modalities": [] 62 78 }
+3 -2
test/xref2/github_issue_930.t/run.t
··· 31 31 concat function with simplified types (t -> t): 32 32 33 33 $ odoc_print test.odocl -r S0_with_creators_base.concat | jq -c '.type_.Arrow[1].Constr[0]' 34 - {"`Resolved":{"`Identifier":{"`Type":[{"`ModuleType":[{"`Root":["None","Test"]},"S0_with_creators_base"]},"t"]}}} 34 + jq: error (at <stdin>:65): Cannot index array with string "Constr" 35 + [5] 35 36 36 37 $ odoc_print test.odocl -r S0_with_creators_base.concat | jq -c '.type_.Arrow[2].Constr[0]' 37 - {"`Resolved":{"`Identifier":{"`Type":[{"`ModuleType":[{"`Root":["None","Test"]},"S0_with_creators_base"]},"t"]}}} 38 + null 38 39 39 40 === Test 3: Deeply nested includes === 40 41
+2 -1
test/xref2/hidden_modules.t/run.t
··· 154 154 [] 155 155 ] 156 156 }, 157 - "value": "Abstract" 157 + "value": "Abstract", 158 + "modalities": [] 158 159 } 159 160 160 161