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

documentation: centralized and parallel builds #9996

Merged
merged 6 commits into from Dec 9, 2020

Conversation

Octachron
Copy link
Member

This PR proposes to centralize the generation of the documentation for the standard library and the compiler library in one place.

Currently, this build process is scattered between ocamldoc/ and manual/, with slight differences between the two.

This PR moves all the documentation generation logic to a new doc/ directory with the aim to make it easier to tweak the documentation build process (see the next PR).

The new Makefile also handles parallel build for the manpages, accelerating the build process, and making it somewhat incremental.

@gasche
Copy link
Member

gasche commented Oct 30, 2020

The idea sounds fine but I don't like doc/. This is the place where, as a newcomer browsing the code repository, I will go to expect to find documentation (maybe on the compiler itself, maybe on the development process). Your directory:

  • is not the right place to look for (in the sources) to find documentation
  • is not about general documentation of the compiler, but just of the standard library

I would propose either stdlib/docgen or manual/stdlib as better paths for the new "central" place.

@Octachron
Copy link
Member Author

The generated documentation also covers part of the compiler library. I think docgen could work, or maybe api_doc?

@gasche
Copy link
Member

gasche commented Nov 18, 2020

We discussed this Very Important Naming Question and agreed on api_docgen at the root directory.

Copy link
Member

@gasche gasche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks generally good except for a few questions left. I am "approving" in advance of @Octachron handling them in a best-effort way.

#**************************************************************************

define capitalize
$(shell echo $(1) | sed "s/\<./\U&/g")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this magic sed stuff sed "s/\<./\U&/g" work on exotic systems with old Sed versions? (@Octachron and myself wondered if we should use a small OCaml script instead, but properly dealing with spaces-in-directories might be trickier.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this magic sed stuff sed "s/\<./\U&/g" work on exotic systems with old Sed versions?

The \U replacement (meaning "convert to uppercase", I guess) is no documented in POSIX sed, so the answer is no, it's not going to work everywhere. And it's the first time I see this replacement!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a classic sed implementation that I've been using since the 90's:

sed -e 'h
s/\(.\).*/\1/
y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/
G
s/\n.//'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the good sed scripts are from the 90s :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a sed-free solution. Recommended!

define capitalize
$(shell echo $(1) | cut -c1 | tr '[:lower:]' '[:upper:]')$(shell echo $(1) | cut -c2-)
endef

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then let's go for the recommended solution and a bit of glue rather than a GNUism.

@gasche gasche added the merge-me label Dec 1, 2020
@gasche
Copy link
Member

gasche commented Dec 1, 2020

There seems to be a relevant failure that the full-flambda CI complains about:

+ make -j -C ocamldoc html_doc pdf_doc texi_doc
make: Entering directory '/home/runner/work/ocaml/ocaml/ocamldoc'
make: *** No rule to make target 'html_doc'.  Stop.
make: Leaving directory '/home/runner/work/ocaml/ocaml/ocamldoc'
Error: Process completed with exit code 2.

@Octachron
Copy link
Member Author

Indeed, I forgot to update the patch to the CI after @dra27 changes.

@Octachron Octachron removed the merge-me label Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants