2

I'm in an internal package of my project and I ran dune build @doc. It does not complain and runs to completion. I then check the /_build/default directory and no _doc directory exists.

Am I missing something?

ghilesZ
  • 1,502
  • 1
  • 18
  • 30
David 天宇 Wong
  • 3,724
  • 4
  • 35
  • 47
  • Did you try following [dune documentation](https://dune.readthedocs.io/en/stable/documentation.html)? – Nalin Ranjan Oct 21 '21 at 09:12
  • 1
    Looks correct, except that the folder is `_build/default/_doc`, i.e., no leading `/`, which is the root folder. Otherwise, please provide more information about the structure of your project. This is the correct way of building docs with dune, so if it doesn't work then it means that there are some issues with either your project or dune itself. – ivg Oct 21 '21 at 15:33
  • @NalinRanjan that's where I got the command from yeah, I tried building the private doc (maybe the package is considered private?) but no luck – David 天宇 Wong Oct 21 '21 at 19:03
  • @ivg I wrote `/_build` to point out that I'm at the root of the project, should have written `/path/to/project/_build` which is clearer – David 天宇 Wong Oct 21 '21 at 19:04
  • if there was a problem with the project or dune itself I would hope that the dune command would show that something went wrong... but no – David 天宇 Wong Oct 21 '21 at 19:05
  • 2
    I agree. The only legit reason for not generating documentation is the absence of the code, so make sure that at least your build works and builds something. – ivg Oct 21 '21 at 19:57

1 Answers1

0

You should simply be able to generate docs by running dune build @doc if you have foo.ml, foo.opam, and a dune file containing simple contents. For example,

(library
   (name foo))

To answer the question, the package name should be related to the library name or public name (if added as a stanza to the dune file).

lubegasimon
  • 21
  • 1
  • 5