We've released odoc
2.4.2 with OCaml 5.2 compatibility and a few bug fixes.
See full changelog
Added
- OCaml 5.2.0 compatibility (@Octachron, #1094, #1112)
Fixed
- Fix issues #1066 and #1095 with extended opens (@jonludlam, #1082, #1100)
Read the latest releases and updates from the OCaml ecosystem.
We've released odoc
2.4.2 with OCaml 5.2 compatibility and a few bug fixes.
The release of odoc
2.4.0 last month introduced a regression that caused Dune rules to fail in some cases. This release of odoc
2.4.1 fixes this issue.
The odoc team is delighted to announce the release of odoc 2.4.0. It mainly contains support for search engines. There are of course bugfixes and smaller new features.
Odoc now support searching in the documentation ! The search is made to run in the browser, so that you do not need a server to enable search: you can have search on your documentation hosted on github pages or even locally on your machine.
No search engine is shipped with, you need to provide one, but all the facilities to make use of one are present. We adapted @art-w 's sherlodoc for seamless integration with odoc, alongside with new features. It is not yet released on opam, but we hope it will be soon.
You can already test sherlodoc and play with it on your own projects, there are instructions in its readme. Sherlodoc has fuzzy typed-based search like hoogle in the haskell world, and is made to work best for OCaml (unlike a general purpose search engine like elastic search).
Check the results on odoc's own online documentation : ocaml.github.io/odoc.
While we are dedicated to developing the best tooling to generate and serve documentation on OCaml.org, creating a well-documented library ecosystem can only be a collective effort. Package authors: we’re working hard to give you great tools, but we’ll need all your help to create an ecosystem of well-documented libraries for OCaml!
If you find that writing documentation for your library isn’t as straightforward as you would like, please do share your feedback with us.
Following the release of odoc
2.3.0, we're releasing a patch release with odoc
2.3.1 that fixes support for OCaml 5.1.
We are thrilled to announce the release of odoc 2.3.0! 🎉 This release is the result of almost a year of diligent work from the odoc team since the last major release of odoc 2.2.0, it comes packed with significant new features and improvements!
Here are a couple of the new features introduced in Odoc 2.3.0 that we'd like to highlight.
Table support is the last addition to the odoc language, and comes with two syntax flavours: a light one, and a heavy one. The light markup is similar to markdown's markup for table, producing tables that are readable in the source file as well.
However, this markup has some limitation, since it only allows inline content in cells. It can also be difficult to read and mantain for big tables, without a proper editor support. For this reason, Odoc also provides a "heavy" markup, closer to the html one, with fewer limitations!
Here is a table in heavy, light, and rendered form:
{t
Table | support
------|--------
is | cool!
}
{table
{tr {th Table} {th support}}
{tr {td is} {td cool!}}
}
Table | support ------|-------- is | cool!
Source code rendering is an extremely exciting new feature. Not only odoc is now able to generate a rendering of the source files (and source hierarchy) of a project, but it is also able to create direct links from the documentation to the implementation!
This puts the documentation browsing to a new level, by helping to quickly answer any implementation-related question!
The source code rendering is also tailored to OCaml, for instance with links from variables to their definition, something missing from traditional html-based source viewing such as github!
Using this features in odoc’s driver will require some work, but you can already have a preview of the feature by going to the odoc API website, which was built with the feature enabled. For instance, the Odoc_html 19 module is now populated with many Source links, jumping right into the implementation file 5! Directory pages to browser the implementation are also included 8 :smiley:
Some background on our roadmap and what comes next.
The lack of access to comprehensive documentation for OCaml libraries is one of the biggest pain points reported by the OCaml community, as highlighted in the 2022 OCaml survey (c.f. Q50).
This motivated the odoc and OCaml.org teams to jointly work on a centralised package documentation, that went live in April 2022, as part of the new version of OCaml.org.
With documentation for OCaml libraries readily available on OCaml.org, we now turn our focus on making sure that library authors have the tooling they need to create high-quality documentation.
Our roadmap highlights some features we believe will make the generated documentation significantly better for readers, and documentation-writing much more pleasant and rewarding.
This release is a significant milestone in implementing the features on our roadmap and is the precursor to a series of upcoming releases. Odoc 2.4.0 will follow shortly and will bring support for search. Stay tuned and follow our progress through the OCaml Platform newsletter!
While we are dedicated to developing the best tooling to generate and serve documentation on OCaml.org, creating a well-documented library ecosystem can only be a collective effort. Package authors: we're working hard to give you great tools, but we'll need all your help to create an ecosystem of well-documented libraries for OCaml!
If you find that writing documentation for your library isn't as straightforward as you would like, please do share your feedback with us.
--hidden
not always taken into account (@panglesd, #940)As OCaml 5.1 is on the horizon, we're excited to announce the release of odoc 2.2.1. This latest version brings compatibility with the upcoming OCaml 5.1 release.
Additions
Additions
--as-json
for the HTML renderer that emits HTML
fragments (preamble, content) together with metadata (table of contents,
breadcrumbs, whether katex is used) in JSON format. (@sabine, #908){m ... }
and {math ... }
tags. (@giltho, @gpetiot, #886)Bugfixes
Additions
Bugs fixed
val x : #c
) (@jonludlam, #809)Additions
Bugs fixed
val x : #c
) (@jonludlam, #809)Additions
Bugs fixed
Additions
Hot on the heels of the OCaml 4.13 announcement(s!), the odoc
team is pleased to announce the release of odoc 2.0.0
!
tl;dr: The new version produces much better output than the old version, it's the engine at the core of the package docs in v3.ocaml.org, and it also has a new website.
This release has been a long time coming -- years! -- and contains several notable improvements over the odoc 1.5
series: a new language model, a new rendering layer allowing output in several formats, and improved control over the output structure.
The internal library used by odoc
that models the OCaml module system has been completely rewritten over a multi-year effort by @jonludlam and @Julow, according to a design by @lpw25. The rewrite gives odoc
a much better understanding of the module system compared to the original implementation. This library is used for two main processes:
odoc
takes complex module type expressions like this one from tyxml:module Make
(Xml : Xml_sigs.T with type ('a, 'b) W.ft = 'a -> 'b)
(Svg : Svg_sigs.T with module Xml := Xml)
: Html_sigs.Make(Xml)(Svg).T
with type +'a elt = Xml.elt
and type +'a attrib = Xml.attrib
Then turns it into an output page containing the correct types, values, modules, includes, and documentation.
odoc
handles complex paths found in OCaml source in order to calculate the correct definition link. For example, in the following snippet:module type A = sig
module M : sig module type S end
module N : M.S
end
module B : sig module type S = sig type t end end
module C : A with module M = B with type N.t = int
type t = C.N.t
resolution is the process by which odoc
determines which documentation page to take you when you click on C.N.t
.
The new model has logic to handle many features of the OCaml language, as can be explored here.
A particularly important improvement is in handling canonical modules (explained in the link above). The upshot of this is that there should never be any more odd double underscores leaking into your docs!
For some more info on this, as well as the new output renderers, see our talk at the OCaml workshop last year
@Drup put a considerable amount of work into replacing the odoc 1.5
custom HTML generator with a new rendering layer. This features a new intermediate format allowing new output formats to be added far more easily than before.
Included in odoc 2.0
are renderers for HTML and man pages (both contributed by @Drup) and LaTeX (contributed by @Octachron). The LaTeX renderer has already been integrated into the OCaml build process to generate docs (see https://github.com/ocaml/ocaml/pull/9997 and related PRs). @jonludlam also made an alternative HTML renderer designed specifically for v3.ocaml.org. Finally, a new markdown renderer is being prepared by @lubegasimon and should land in the next release.
We look forward to many new renderers being created for the varied use cases present in the community!
odoc 2.0
introduces a new mechanism to specify the structure of the files produced. Although it's a relatively simple new feature, it nevertheless has enabled odoc
to be used in new ways. In particular, it has allowed odoc
to construct the
package documentation for the new OCaml website, v3.ocaml.org. There is also an example driver, showing how odoc
can be used to construct a stand-alone website for an OCaml package that contains fully-linked documentation for a package and all of its dependencies. This has been used to create odoc
's new website.
Like the OCaml compiler itself, running odoc
on your code requires careful sequencing of the invocations to produce the correct result. Fortunately both dune
and odig
understand how to do this, so most users don't need to know the details. If you want more than these tools provide though, we've written a simple reference driver, documenting exactly what's necessary to use odoc
to produce rich documentation. A more complete (and more complex) example is the tool voodoo, which is being used to create the docs for v3.ocaml.org.
As previously posted, the new version of the OCaml website has been under development for some time now, and an important new feature is the integration of package listings, including documentation for every version of every package. More has been written about this elsewhere, but it's important to note that the new OCaml.org website required a preview version of odoc 2.0
to work. We've made a few bug fixes since then, so we will update the pipeline to use the released version very soon. For more info on the pipeline to build the docs, see our recent talk at this year's OCaml Workshop.
The website for odoc
has been improved with guides for documentation authors, integrators, and contributors. This site is intended to grow over time with more content to help people write docs for their packages.
This release, particularly because of the new output renderers, puts odoc
in a place where it supercedes OCamldoc in most respects. There are a few features we're missing (see the comparison in the docs), including
most notably that we don't render the source (OCamldoc's --keep-code
argument), and that there is no support for custom tags. If odoc
is lacking features that you're currently relying on in OCamldoc, we'd love to hear from you!
Finally, I'd like to use this opportunity to launch an invitation. With v3.ocaml.org now showing all the package docs in their current state, I'd like to invite all our package authors, maintainers, contributors, and users to take a look over their favourite packages and see what the documentation looks like. Good documentation is one of the most important requests from the previous OCaml developer surveys, and with v3.ocaml.org as a new documentation hub, now is a great time to be making improvements where they're required. With this new release of odoc
, previewing your docs should be as simple as dune build @doc
.
Some packages already have great docs - a few examples are:
many others have more patchy docs. Let's fix that!
We're also looking for more contributors to odoc
. It's much improved now, but there's still plenty more to do. Come and join the fun!
Breaking changes
Additions
{!modules:...}
(@Julow, #597)Bugs fixed
uwt
now can be documented (@jonludlam, #708)Additions
Additions
Additions
Additions
Bugs fixed
Bugs fixed
:
characters (#384,
reported Sylvain Le Gall).<meta generator>
again (#378, Daniel Bünzli).odoc html-targets
was ignoring deeply nested modules (#379, Daniel
Bünzli).List.iter2
(#376, Yotam Barnoy).Bugs fixed
<span>
s (#360, Thomas
Refis)..mld
pages (#361, Rizo Isrof).:
instead of =
(#344, Geoff Reedy).*
instead of &
(#353, Florian Angeletti).+=
) printed without CSS classes found in other items (#348,
reported Stéphane Lavergne).--mute
(#345,
Geoff Reedy).We are pleased to announce release 1.4.0 of odoc, the new, Dune-friendly documentation generator for OCaml and ReasonML.
You can install odoc and generate docs for your Dune project with:
opam update
opam install odoc
dune build @doc
Then, view the docs by opening _build/default/_doc/_html/index.html
!
While release 1.4.0 has new features, it is mainly focused on stability and maintainability. See its full changelog here. The previous release, 1.3.0 last October, included a lot of new code. Because of concerns about its stability, we chose not to widely announce 1.3.0. So, this message serves as an announcement for both releases :) The full changelog for 1.3.0 can be found here.
In summary, compared with 1.2.0, odoc
now has:
For now, we plan to continue improving the stability of odoc and the quality of its output. In the longer term, odoc has two significant goals:
To replace ocamldoc as OCaml's primary documentation generator. At the core of odoc is a powerful cross-referencer, capable of fully handling the complexity of OCaml's module system. Shortcomings in ocamldoc's ability to resolve cross-references in complex projects were one of the original motivations for starting odoc.
To create centrally-hosted, cross-referenced, searchable online documentation for all the published packages in opam, a “docs.ocaml.org
.”
Thanks to the odoc users and contributors, and happy documenting!
Changes
{0 ...}
), and top-level sections
within a page are level-1 headings ({1 ...}
) (#217, Rizo Isrof).--root-uri
option to --xref-base-uri
(#223, Rizo Isrof).Additions
{4 ...}
) and subparagraph headings ({5 ...}
) (#217,
Rizo Isrof).odoc support-files-targets
command (#232).bsdoc
for using
odoc
with BuckleScript (#269, Leandro Ostera).Bugs fixed
.mld
pages (#293, Daniel Buenzli).-
in them,
such as @->
(#178)..
in them, such as *.
(#237)..ml
file with a
type annotation, when that type annotation uses an alias of 'a option
(#101).{v ... v}
) can now only be terminated if the v}
is
immediately preceded by whitespace (#71, reported Daniel Buenzli).type
keyword instead of and
rendered in HTML for
mutually-recursive types (#105, reported @Fourchaux).nonrec
keyword not rendered (#249).and
not rendered for mutually-recursive modules, classes, and class types
(#251).constraint
clauses (#321).odoc html
option -o
now creates the output directory if it does not exist
#171, #264 Rizo Isrof).odoc html-targets
output now includes path prefix given through -o
option
(#173, Rizo Isrof).-I
and -o
options to refer to non-existent directories (#32, #170,
Daniel Buenzli).odoc compile-targets
match odoc compile
(#273, Daniel Buenzli).odoc compile-deps
does not work on .cmt
files (#162, Daniel Buenzli).odoc html-deps
now scans for .odoc
files recursively (#307, Daniel
Buenzli).odoc html-targets
ignores stop comments (#276, Daniel Buenzli).odoc html-targets
and odoc html-deps
segfault on .mld
pages (#277, #282,
Daneil Buenzli).--theme-uri
option not propagated to some subpages (#318, Thomas Refis).Build and development
make
in the esy build (#308, Leandro Ostera).bos
(#305, Daniel Buenzli).rresult
(#306, Daniel Buenzli).bisect_ppx
, previously present in development
checkouts (#316).Additions
odoc
binary is now self-contained and requires no external
files (bd3b53c).--theme-uri
option (#154, Rizo Isrof)..mld
to HTML fragments rather than complete pages
(#166, Rizo Isrof).Bugs fixed
page-
to output file name when compiling .mld
files
(#183, Rizo Isrof).floatarray
type introduced in OCaml 4.06 (eb36158, Thomas
Refis).<i>
tags in italics (#104, Thibault Suzanne).Build and development
odoc
is now one repo.CONTRIBUTING.md
, tests,
coverage analysis, CI, and issue organization..mld
files) (#61).[@@deprecated]
attributes as the @deprecated
tag (#57).kind-identifer
syntax (part of #61).html-deps
subcommand behavior: it now expects to be given a
directory, not a single odoc file.Initial release.