Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to resolve references in stage 0 #1261

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix errors in odoc's docs
jonludlam authored and panglesd committed Dec 12, 2024
commit 269661fdf1427f316c6e1e4345982681e615467d
1 change: 0 additions & 1 deletion doc/examples/resolution.mli
Original file line number Diff line number Diff line change
@@ -86,7 +86,6 @@ module Hidden : sig

type v = T of t

type w = U of u
end

module References : sig
4 changes: 1 addition & 3 deletions doc/odoc.mld
Original file line number Diff line number Diff line change
@@ -58,6 +58,4 @@ The main other pages of this site:
- {!page-ocamldoc_differences} outlines differences from OCamldoc.
- {!page-dune} shows how to create docs using Dune.
- {!page-parent_child_spec} delineates parent/child specifications.
- {!page-interface} describes [odoc]'s public-facing interface and their support guarantees.
- {!page-ocamlary} demonstrates the rendering of most of the OCaml constructs.
- {!page-api_reference} lists [odoc]'s API reference library.
- {!page-interface} describes [odoc]'s public-facing interface and their support guarantees.
5 changes: 5 additions & 0 deletions dune
Original file line number Diff line number Diff line change
@@ -23,3 +23,8 @@
(progn
(bash "diff doc/driver.mld doc/driver.mld.corrected >&2 || true")
(cat doc/driver-benchmarks.json))))

(install
(files odoc-config.sexp)
(section doc)
(package odoc))
2 changes: 2 additions & 0 deletions odoc-config.sexp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(libraries fmt)

6 changes: 3 additions & 3 deletions src/model/paths_types.ml
Original file line number Diff line number Diff line change
@@ -551,9 +551,9 @@ module rec Reference : sig
type tag_only_child_module = [ `TChildModule ]

type tag_hierarchy =
[ `TRelativePath (** {!identifier/} *)
| `TAbsolutePath (** {!/identifier} *)
| `TCurrentPackage (** {!//identifier} *) ]
[ `TRelativePath (** [{!identifier/}] *)
| `TAbsolutePath (** [{!/identifier}] *)
| `TCurrentPackage (** [{!//identifier}] *) ]
(** @canonical Odoc_model.Paths.Reference.tag_hierarchy *)

type tag_any =
7 changes: 0 additions & 7 deletions src/ocamlary/ocamlary.mli
Original file line number Diff line number Diff line change
@@ -1068,10 +1068,3 @@ type new_t = ..
type new_t += C

module type TypeExtPruned = TypeExt with type t := new_t

(** {1 Unresolved references} *)

(** - {!Stdlib.Invalid_argument}
- {!Hashtbl.t}
- {!Set.S.empty}
- {!CollectionModule.InnerModuleA.foo} *)
2 changes: 1 addition & 1 deletion src/search/html.mli
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ val url : Entry.t -> string

(** The below is intended for search engine that do not use the Json output but
Odoc as a library. Most search engine will use their own representation
instead of {!Entry.t}, and may not want to store the whole HTML in their
instead of {!Odoc_index.Entry.t}, and may not want to store the whole HTML in their
database. The following functions help give correct values to store in a
search database. *)

2 changes: 1 addition & 1 deletion src/search/odoc_html_frontend.mli
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(** This library is intended for search engine that do not use the Json output
but Odoc as a library. Most search engine will use their own representation
instead of {!Entry.t}, and may not want to store the whole HTML in their
instead of {!Odoc_index.Entry.t}, and may not want to store the whole HTML in their
database.
This library contains functions that are useful for the frontend of such
search engines.
2 changes: 1 addition & 1 deletion src/utils/odoc_list.ml
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ let rec filter_map acc f = function

let filter_map f x = filter_map [] f x

(** @raise [Failure] if the list is empty. *)
(** @raise Failure if the list is empty. *)
let rec last = function
| [] -> failwith "Odoc_utils.List.last"
| [ x ] -> x
8 changes: 0 additions & 8 deletions test/generators/html/Ocamlary.html
Original file line number Diff line number Diff line change
@@ -71,7 +71,6 @@ <h1>Module <code><span>Ocamlary</span></code></h1>
</li><li><a href="#aliases">Aliases again</a></li>
<li><a href="#section-title-splicing">Section title splicing</a></li>
<li><a href="#new-reference-syntax">New reference syntax</a></li>
<li><a href="#unresolved-references">Unresolved references</a></li>
</ul>
</nav>
</div>
@@ -2961,13 +2960,6 @@ <h2 id="new-reference-syntax">
</code>
</div>
</div>
<h2 id="unresolved-references">
<a href="#unresolved-references" class="anchor"></a>Unresolved references
</h2>
<ul><li><code>Stdlib.Invalid_argument</code></li>
<li><code>Hashtbl.t</code></li><li><code>Set.S.empty</code></li>
<li><code>CollectionModule.InnerModuleA.foo</code></li>
</ul>
</div>
</body>
</html>
5 changes: 0 additions & 5 deletions test/generators/latex/Ocamlary.tex
Original file line number Diff line number Diff line change
@@ -895,11 +895,6 @@ \subsection{New reference syntax\label{new-reference-syntax}}%
\label{Ocamlary-module-type-TypeExtPruned-val-f}\ocamlcodefragment{\ocamltag{keyword}{val} f : \hyperref[Ocamlary-type-new_t]{\ocamlinlinecode{new\_\allowbreak{}t}} \ocamltag{arrow}{$\rightarrow$} unit}\\
\end{ocamlindent}%
\ocamlcodefragment{\ocamltag{keyword}{end}}\\
\subsection{Unresolved references\label{unresolved-references}}%
\begin{itemize}\item{\ocamlinlinecode{Stdlib.\allowbreak{}Invalid\_\allowbreak{}argument}}%
\item{\ocamlinlinecode{Hashtbl.\allowbreak{}t}}%
\item{\ocamlinlinecode{Set.\allowbreak{}S.\allowbreak{}empty}}%
\item{\ocamlinlinecode{CollectionModule.\allowbreak{}InnerModuleA.\allowbreak{}foo}}\end{itemize}%

\input{Ocamlary.ModuleWithSignature.tex}
\input{Ocamlary.ModuleWithSignatureAlias.tex}
15 changes: 0 additions & 15 deletions test/generators/man/Ocamlary.3o
Original file line number Diff line number Diff line change
@@ -1902,18 +1902,3 @@ Here goes:
\f[CB]val\fR f : new_t \f[CB]\->\fR unit
.br
\f[CB]end\fR
.sp
.in 3
\fB8 Unresolved references\fR
.in
.sp
.fi
\(bu Stdlib\.Invalid_argument
.br
\(bu Hashtbl\.t
.br
\(bu Set\.S\.empty
.br
\(bu CollectionModule\.InnerModuleA\.foo
.nf