-
Notifications
You must be signed in to change notification settings - Fork 415
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
Refactor odoc generation and fix the private doc alias #864
Conversation
a1b8d2b
to
9864a12
Compare
@diml in the last commit, I'm using a slightly different approach for calculating the closure for private and public libs. This is because we want libraries in the same package to refer to each other in the docs (even if there's no dependency) |
This should fix the private doc generation @bobbypriambodo @bluddy |
This makes sense to me. |
BTW, I have only a very superficial knowledge of odoc. @rgrinberg if there are specific commits or parts you'd like additional review on let me know, otherwise as long as it produce the expected results I think we can merge this without additional review. |
Thanks @rgrinberg! I can try it out in a few hours if @bluddy doesn't beat me to it. |
@diml the review request was mostly for your comment that I addressed here. The private docs are generated as expected on my end. |
Ok, I looked at this commit and I agree with it. |
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
cc @diml Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
Separate package from html docs Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
private-doc should collect html rather than odoc aliases Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
This allows for circular dependencies for libraries in the same package Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
I just tried the changes in this PR, and it generated the private docs correctly. One behavior I find a bit odd is that |
I believe this from this bit: https://github.com/rgrinberg/jbuilder/blob/doc-private/src/odoc.ml#L166-L173 @trefis did you write this initially? How come we need to clear the html directory? |
Err... can't remember. Without much thinking I'd say that there can (theoretically) be some interaction between the two (e.g. some |
Actually that was me. It is hard to predict in advance what files odoc will produce. Odoc has a command to list the files it will create, but we don't have dynamic targets. So what we do instead is delete the directory where odoc produces the files every time before running odoc and we add this special keepme file to tell Dune to not eagerly delete the directory; since it doesn't know the files in it are targets, it would otherwise thinks they are stale artifacts. |
private-doc needed to collect the html alias of each library rather than the odoc alias. The rest are just small refactorings.
@diml I think I addressed the comment that you've left for me in the source. Failing when the transitive closure is absent indeed makes sense. Even if we can still technically continue and generate suboptimal docs.
There are still many inefficiencies abound in the doc generation, but I'm thinking that this isn't an issue for people in practice. As long as the rules minimize the weight they add on normal builds.