-
Notifications
You must be signed in to change notification settings - Fork 413
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
New odoc rules #304
New odoc rules #304
Conversation
According to b0-system/odig#31 and b0-system/odig#18 it's rather |
Do you then namespace the |
Yes, in the sense that every |
I think it does. If two libraries define
and only once per package. |
Curious as to why we need to allow jbuilder to specify |
Right, because library and package are two distinct things.
I've personally always found that distasteful. |
Ping |
Is this a ping to me? I'm fine with you allowing mld files in other directories. Though I'd like to hear a second opinion from another maintainer (like @bobot for example). Seems like this PR is still WIP though? Or is there something you wanted us to work on? Btw, this needs a rebase on top of master. |
For both of you actually. As for the second question yes, the ping was for "jbuilder's dev" in the general sense yes. |
In that case same directory is the safest. We could still use the unsatisfying |
So I gather you will then namespace the My impression is that manuals are going to be per package rather than per library this is why I would rather advocate a |
Sounds good to me!
The can be added after the fact then, with a I do think that pages inside a library, i.e. not part of a "standalone" manual, still make sense though. Don't they? |
I agree that the manuals installed will be by package, since only packages are installed. Libraries that are not part of a package should still be able to have a documentation, locally installed.
Currently two libraries can't be part of the same exact package, but in the future we could accept it. If they are installed in the same directory they are part of the same package and so jbuilder could detect the conflict. Or if the basename can't be arbitrary because it must corresponds to a module name, I don't see how the doc directory solves the problem.
I'm also a little lost on where and what odoc wants to install. |
I think the discussion is getting a little bit confusing here. I don't see how ocaml/odoc#94 would interact nicely with my proposal this is a global namespace. I'm not sure exactly what @bobot says with "currently two libraries can't be part of the same exact package". As far as documentation is generated by Here are a few points:
|
I haven't been following this too closely, but I basically agree with @dbuenzli on this. SInce odoc manages documentation for opam packages rather than libraries it is packages that jbuilder should associate the |
I don't think that's quite right. I think the public name of the library has to be of the form Anyway, thanks for the precisions / clarifications. |
Just to clarify, I don't think it is the mixing of |
There's a test failure with one of my recently introduced tests:
I've seen an error like this pop up before as well in ppx_tools_versioned or omp - can't remember. You should be able to reproduce by rebasing and running |
I've added some real odoc tests now as well. So this PR should be rebased on top, and those be updated if necessary. |
Fix conflict between odoc generation and bug fix for generating docs for libs with non unique names.
I've resolved the conflicts in this branch with master. @trefis please have a look. The odoc test suite is still failing because it doesn't yet support generating an index.html for multiple libraries defined in the same directory. OK so the
Where mlds is optional and work about the same way as |
cc @aantron as well on this issue |
There's no need for extra_targets because we can use Target
To avoid conflicts whenever there are multiple libraries in one dir
Another thing to consider is the generation of documentation for libraries that don't belong to any opam package because they aren't being installed. It seems like @MiloDavis uses that feature so it might make sense to consider attaching .mld files to libraries as well. |
That sounds right. |
This reverts commit 9334cf7.
no need for regex
I tried doing this but there are a lot of complications with this. Like fixing all the globs. I still think this is a good idea but I also don't think it's such a good idea to have special code for this just for documentation. What I'd like to see instead is dune creating separate dirs in _build for building libraries, executables, documentation in isolation. What ended being easier was just renaming the .odoc files and then doing a little preprocessing on the generated .html because odoc doesn't let me control the .html names generated. |
Disregard my last comment as I gave it another and it turned out not to be so bad to generate the odoc stuff in its own dir. |
Just highlighting this bit for @aantron -- it sounds like something that can be fixed in the odoc frontend to make build system integration easier? |
It's possible. I'm thinking through several related issues. I think one of the main reasons odoc doesn't give control over the filenames generated is that it one |
Even if some support for inlining some modules is added to |
I think odoc doesn't give control over the generated HTML locations because to have at least some idea of where they are to generate correct links. |
@rgrinberg We restructured the project in question (Tezos)[https://github.com/tezos/tezos/], to avoid this issue. |
Implementation continues at #570 |
Recreating after the accidental close of the previous PR.
The odoc rules, as implemented in this PR, work with the git version of odoc and follow the guidelines listed here.
Currently, for a given library,
.mld
files are found in the same directory as normal source files (i.e. in the same directory as the jbuild).Things that need to happen before merging this
we need a way to put.mld
files in an arbitrary directory and tell jbuilder where to find them. The way I currently have in mind is an addition to the jbuild type of libraries to allow writing:where something should probably follow this syntax.mld
files in$DOCDIR/$PKG/odoc-pages
(at least that's what I understand from this comment, but @dbuenzli will correct me if I'm wrong).