Skip to content

Commit b421e25

Browse files
committed
Don't render synopsis of include items
Removes the exception added in the previous commit. We don't fallback to rendering the synopsis when there is no documentation attached.
1 parent 6f05009 commit b421e25

File tree

4 files changed

+4
-16
lines changed

4 files changed

+4
-16
lines changed

src/document/generator.ml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,7 +1536,7 @@ module Make (Syntax : SYNTAX) = struct
15361536
| ModuleType mt -> umty mt
15371537
in
15381538

1539-
let sg_doc, content = signature t.expansion.content in
1539+
let _, content = signature t.expansion.content in
15401540
let summary =
15411541
O.render
15421542
(O.keyword "include" ++ O.txt " " ++ include_decl
@@ -1550,10 +1550,8 @@ module Make (Syntax : SYNTAX) = struct
15501550
declarations, which show only the synopsis. We can't only show the
15511551
synopsis because no page is generated to render it and we'd loose
15521552
the full documentation.
1553-
As an exception, the synopsis from the expansion is used iff there
1554-
is no documentation. *)
1555-
if t.doc <> [] then Comment.to_ir t.doc
1556-
else Comment.synopsis ~decl_doc:[] ~expansion_doc:(Some sg_doc)
1553+
The documentation from the expansion is not used. *)
1554+
Comment.to_ir t.doc
15571555
in
15581556
Item.Include { attr; anchor; doc; content }
15591557
end

test/html/expect/test_package+ml/Include2/Y_include_synopsis/index.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ <h1>
2727
</header>
2828
<div class="odoc-content">
2929
<div class="odoc-include">
30-
<div class="spec-doc">
31-
<p>
32-
Top-comment of Y.
33-
</p>
34-
</div>
3530
<details open="open">
3631
<summary class="spec include">
3732
<code><span><span class="keyword">include</span> <span class="keyword">module</span> <span class="keyword">type</span> <span class="keyword">of</span> <span class="keyword">struct</span> <span class="keyword">include</span> <a href="../Y/index.html">Y</a> <span class="keyword">end</span></span></code>

test/html/expect/test_package+re/Include2/Y_include_synopsis/index.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ <h1>
2727
</header>
2828
<div class="odoc-content">
2929
<div class="odoc-include">
30-
<div class="spec-doc">
31-
<p>
32-
Top-comment of Y.
33-
</p>
34-
</div>
3530
<details open="open">
3631
<summary class="spec include">
3732
<code><span><span class="keyword">include</span> <span class="keyword">module</span> <span class="keyword">type</span> <span class="keyword">of</span> <span class="keyword">struct</span> <span class="keyword">include</span> <a href="../Y/index.html">Y</a> <span class="keyword">end</span><span class="keyword">;</span></span></code>

test/latex/expect/test_package+ml/Include2.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ \section{Module \ocamlinlinecode{Include2}}\label{container-page-test+u+package+
1010
\end{ocamlindent}%
1111
\ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}Top-comment of Y.\end{ocamlindent}%
1212
\medbreak
13-
\label{container-page-test+u+package+++ml-module-Include2-module-Y+u+include+u+synopsis}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[container-page-test+u+package+++ml-module-Include2-module-Y+u+include+u+synopsis]{\ocamlinlinecode{Y\_\allowbreak{}include\_\allowbreak{}synopsis}}}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}Top-comment of Y.\ocamltag{keyword}{include} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \ocamltag{keyword}{struct} \ocamltag{keyword}{include} \hyperref[container-page-test+u+package+++ml-module-Include2-module-Y]{\ocamlinlinecode{Y}} \ocamltag{keyword}{end}\label{container-page-test+u+package+++ml-module-Include2-module-Y+u+include+u+synopsis-type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t = \hyperref[container-page-test+u+package+++ml-module-Include2-module-Y-type-t]{\ocamlinlinecode{Y.\allowbreak{}t}}}\\
13+
\label{container-page-test+u+package+++ml-module-Include2-module-Y+u+include+u+synopsis}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[container-page-test+u+package+++ml-module-Include2-module-Y+u+include+u+synopsis]{\ocamlinlinecode{Y\_\allowbreak{}include\_\allowbreak{}synopsis}}}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \ocamltag{keyword}{struct} \ocamltag{keyword}{include} \hyperref[container-page-test+u+package+++ml-module-Include2-module-Y]{\ocamlinlinecode{Y}} \ocamltag{keyword}{end}\label{container-page-test+u+package+++ml-module-Include2-module-Y+u+include+u+synopsis-type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t = \hyperref[container-page-test+u+package+++ml-module-Include2-module-Y-type-t]{\ocamlinlinecode{Y.\allowbreak{}t}}}\\
1414
\end{ocamlindent}%
1515
\ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}The \ocamlinlinecode{include Y} below should have the synopsis from \ocamlinlinecode{Y}'s top-comment attached to it.\end{ocamlindent}%
1616
\medbreak

0 commit comments

Comments
 (0)