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

Document required invocations for building docs, and a reference driver. #460

Closed
jonludlam opened this issue Jul 24, 2020 · 4 comments
Closed
Assignees
Milestone

Comments

@jonludlam
Copy link
Member

The way in which odoc should be invoked will be changing as part of the integration of the new model and the new latex/man page generators.

Currently odoc is usually driven by a variety of systems including odig, dune and bsdoc. The exact sequence of calls required is not simple or obvious, and we will be introducing a new link step that sits between the compilation and generation phases.

It's clear we need to document this carefully, but I'd also like to go a step further and produce a 'reference driver' that will execute odoc in the correct sequence. It's likely to be some form of Makefile generation. This is useful for several reasons:

  1. Validation of the documentation
  2. Development while the new invocations are being worked on
  3. Testing
@yawaramin
Copy link
Contributor

It's clear we need to document this carefully, but I'd also like to go a step further and produce a 'reference driver' that will execute odoc in the correct sequence. It's likely to be some form of Makefile generation.

I just re-read this; it seems we are thinking along similar lines right now. I mentioned in reasonml-community/bsdoc#18 that I am planning to use BuckleScript's vendored Ninja build tool, which you may have heard of because it's actually a separate tool that BuckleScript just happens to bundle. I think it's worth a look–Ninja build rules are simple, and the build is super fast–it's part of what makes BuckleScript itself so fast.

For example, here's a rule and target I wrote to build the support files:

rule support_files
  command = $odoc support-files --output-dir=$output_dir # actual executed command
  description = odoc support-files # user-friendly description of command

# build a target: 'build OUTPUT1 [... OUTPUTn]: RULE_NAME [INPUT1 [... INPUTn]]'
build $output_dir/odoc.css $output_dir/highlight.pack.js: support_files

If you're interested, I can send more of this sample Ninja build file I hand-wrote while learning the format.

@dbuenzli
Copy link
Contributor

For example, here's a rule and target

You should not hard-code support-files's outputs, use odoc support-files-targets to determine which files the command writes.

@yawaramin
Copy link
Contributor

@dbuenzli thanks, good to know. Will do.

@jonludlam jonludlam modified the milestones: Replacing ocamldoc, 2.0.0 Jan 28, 2021
@jonludlam jonludlam self-assigned this Feb 12, 2021
@lubegasimon lubegasimon assigned lubegasimon and unassigned jonludlam Apr 9, 2021
@jonludlam
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants