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

Coqdoc support #3760

Closed
rgrinberg opened this issue Sep 4, 2020 · 2 comments · Fixed by #5695 or ocaml/opam-repository#21555
Closed

Coqdoc support #3760

rgrinberg opened this issue Sep 4, 2020 · 2 comments · Fixed by #5695 or ocaml/opam-repository#21555
Assignees
Labels

Comments

@rgrinberg
Copy link
Member

rgrinberg commented Sep 4, 2020

To match the functionality of coq_makefile, dune should support generating documentation for coq theories using coqdoc.

Coqdoc is documented here

Here's an example [1] of a coqdoc rule setup manually:

(rule
   (targets html)
   (deps
    ; This will be replaced soon by `theories/**/*.v` soon, thanks to rgrinberg
    (source_tree %{project_root}/theories)
    (source_tree %{project_root}/plugins)
    (:header %{project_root}/doc/common/styles/html/coqremote/header.html)
    (:footer %{project_root}/doc/common/styles/html/coqremote/footer.html)
    ; For .glob files, should be gone when Coq Dune is smarter.
    (package coq))
  (action
   (progn
    (run mkdir -p html)
    (bash "%{bin:coqdoc} -q -d html --with-header %{header} --with-footer %{footer} --multi-index --html -g -R %{project_root}/theories Coq -R %{project_root}/plugins Coq $(find %{project_root}/theories %{project_root}/plugins -name *.v)")
    (run mv html/index.html html/genindex.html)
    (with-stdout-to
      _index.html
     (progn (cat %{header}) (cat index-list.html) (cat %{footer})))
    (run cp _index.html html/index.html))))

cc @Alizter @ejgallego

[1] https://github.com/coq/coq/pull/9649/files#diff-9ddcc18605a133c6234e2382ffb52a59R27

@rgrinberg rgrinberg added the coq label Sep 4, 2020
@Alizter
Copy link
Collaborator

Alizter commented May 11, 2022

This could very easily be implemented IMO, I already have some coqdoc rules in our test-suite PR.

The difference between these rules today vs. what coq_makefile is doing, is the location coqdoc is being run from, which can effect the names in the documentation. We also need to work out things about index files etc.

There are also two modes for coqdoc: html and latex. This is similar to support for odoc which is being added #5366

@rgrinberg
Copy link
Member Author

Do you want to give this a try then?

@rgrinberg rgrinberg linked a pull request May 19, 2022 that will close this issue
@Alizter Alizter moved this to Todo in Coq + Dune Jun 6, 2022
@Alizter Alizter moved this from Todo to Done in Coq + Dune Jun 6, 2022
kit-ty-kate pushed a commit to ocaml/opam-repository that referenced this issue Jun 17, 2022
…ne-site, dune-rpc, dune-rpc-lwt, dune-private-libs, dune-glob, dune-configurator, dune-build-info, dune-action-plugin and chrome-trace (3.3.0)

CHANGES:

- Sandbox preprocessing, lint, and dialect rules by default. All these rules
  now require precise dependency specifications (ocaml/dune#5807, @rgrinberg)

- Allow list expansion in the `pps` specification for preprocessing (ocaml/dune#5820,
  @Firobe)

- Add warnings 67-69 to dune's default set of warnings. These are warnings of
  the form "unused X.." (ocaml/dune#5844, @rgrinbreg)

- Introduce project "composition" for coq theories. Coq theories in separate
  projects can now refer to each other when in the same workspace (ocaml/dune#5784,
  @Alitzer, @rgrinberg)

- Fix hint message for ``data_only_dirs`` that wrongly mentions the unknown
  constructor ``data_only`` (ocaml/dune#5803, @lambdaxdotx)

- Fix creating sandbox directory trees by getting rid of buggy memoization
  (@5794, @rgrinberg, @snowleopard)

- Handle directory dependencies in sandboxed rules. Previously, the parents of
  these directory dependencies weren't created. (ocaml/dune#5754, @rgrinberg)

- Set the exit code to 130 when dune is terminated with a signal (ocaml/dune#5769, fixes
  ocaml/dune#5757)

- Support new locations of unix, str, dynlink in OCaml >= 5.0 (ocaml/dune#5582, @dra27)

- The ``coq.theory`` stanza now produces rules for running ``coqdoc``. Given a
  theory named ``mytheory``, the directory targets ``mytheory.html/`` and
  ``mytheory.tex/`` or additionally the aliases `@doc` and `@doc-latex` will
  build the HTML and LaTeX documentation repsectively. (ocaml/dune#5695, fixes ocaml/dune#3760,
  @Alizter)

- Coq theories marked as `(boot)` cannot depend on other theories
  (ocaml/dune#5867, @ejgallego)

- Ignore `bigarray` in `(libraries)` with OCaml >= 5.0. (ocaml/dune#5526, fixes ocaml/dune#5494,
  @moyodiallo)

- Start with :standard when building the ctypes generated foreign stubs so that
  we include important compiler flags, such as -fPIC (ocaml/dune#5816, fixes ocaml/dune#5809).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment