question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generate docs with odoc

See original GitHub issue

Dune provides builtin support for documentation generation with odoc. Generating Reason syntax with odoc is already possible. This means that we can generate documentation for any Reason+esy project!

There’re some things that need to be fixed first, in particular:

  • Unattached docstring parsing currently seems to be broken in the Reason parser. (I’ll open a separate issue for this later.)
  • Currently odoc generates OCaml syntax by default. We need to teach dune how to generate Reason syntax for docs (https://github.com/ocaml/odoc/issues/129).
    • This could be done by setting an environment variable
    • Or by generating Reason syntax for rei files
  • The generated docs are currently placed in the _build/default/_doc/_html directory inside esy’s environment. I think asking users to go to that directory to open docs is not ideal.

I already started working on this and expect to have something functional soon.

CC @jordwalke @aantron

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
andreypoppcommented, Dec 10, 2018

Thanks for looking into this! I’ve tried odoc with some of my esy-based projects and I really liked how it looks!

The generated docs are currently placed in the _build/default/_doc/_html directory inside esy’s environment. I think asking users to go to that directory to open docs is not ideal.

In the next esy version it would be possible to reference esy envs from a command line like this:

% esy x '#{self.doc}/_html/index.html'

I think we can add a script esy opendoc which does that.

0reactions
rizocommented, Mar 19, 2019

I think this is done now. Or at least current master is in a good enough shape IMO.

Read more comments on GitHub >

github_iconTop Results From Across the Web

odoc (odoc) - GitHub Pages
odoc is a documentation generator for OCaml. It reads doc comments from your source files and your .mld files, and outputs HTML, LaTeX...
Read more >
Generating Documentation - Dune documentation
Documentation in Dune is done courtesy of the odoc tool. Therefore, to generate documentation in Dune, you will need to install this tool....
Read more >
ocaml/odoc: Documentation compiler for OCaml and Reason
odoc is a documentation generator for OCaml. It reads doc comments , delimited with (** ... *) , and outputs HTML, LaTeX and...
Read more >
Odoc 1.4.0 — new OCaml documentation generator
We are pleased to announce release 1.4.0 of odoc, the new, Dune-friendly documentation generator for OCaml and ReasonML.
Read more >
dart doc
The dart doc command (previously called dartdoc ) creates API reference documentation from Dart source code. You can add descriptions to the generated...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found