Odoc 2.3.0

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!

🌟 Spotlight Features of Odoc 2.3.0

Here are a couple of the new features introduced in Odoc 2.3.0 that we'd like to highlight.

Table Support

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

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:

🗺️ Background & Roadmap

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!

🤝 Join Our Mission

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.

See full changelog

Additions

  • Source code rendering (@Julow, @panglesd, @jonludlam #909, #996, #993, #982)
  • Handle tables markup (@panglesd, @gpetiot, #893)
  • Initial support for assets (@trefis, #975)
  • odoc-parser remerged (@jonludlam, #973) This includes table support (@gpetiot, @panglesd, ocaml-doc/odoc-parser#11 ocaml-doc/odoc-parser#14) and delimited code blocks with optional output (@jonludlam, ocaml-doc/odoc-parser#17)
  • Add a tooltip to references with text (@Julow, #945)
  • Add emoji to alerts in CSS (@yawaramin, #928)
  • Add common language in shipped highlightjs (@Julow, #953)

Bugfixes

  • Fix --hidden not always taken into account (@panglesd, #940)
  • Syntax highlight labels in function arguments (@panglesd, #990)
  • Ensure generated html ends with a newline (@3Rafal, #954)
  • Warn against tags in pages (@Julow, #948)
  • Remove unhelpful 'Unresolved_apply' errors (@gpetiot, #946)
  • Allow links and references in headings (@EmileTrotignon, @panglesd, #942)
  • Fix rendering of method types (@zoggy, #935)
  • Fix section labelling with submodules (@EmileTrotignon, @panglesd, #931)
  • LaTeX backend fixes (@Octachron, #921 #920)
  • html: Remove extra space in class declarations (@Julow, #936)
  • Fix rendering of unresolved references (@Julow, #957)