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

odoc: put odoc support files in odoc.support #7588

Merged
merged 2 commits into from
May 3, 2023

Conversation

emillon
Copy link
Collaborator

@emillon emillon commented Apr 20, 2023

Fixes #7364

If the directory is named _odoc_support with a leading underscore, it is omitted when deploying to github pages. This is because this system also support the jekyll site generator, which uses this convention for data files.

We can not use any directory name here since we want to avoid conflicts with OCaml identifiers and names of *.mld files. Starting with a dot seems to fit the requirements.

@emillon emillon added this to the 3.8.0 milestone Apr 20, 2023
@emillon emillon added the odoc Issues and PRs related to documentation generation with odoc label Apr 20, 2023
@emillon emillon requested review from jonludlam and rgrinberg April 20, 2023 08:53
@Alizter
Copy link
Collaborator

Alizter commented Apr 20, 2023

Should we also check that gh-pages works with this name?

@emillon
Copy link
Collaborator Author

emillon commented Apr 20, 2023

@Alizter
Copy link
Collaborator

Alizter commented Apr 20, 2023

I guess we should bite the bullet and just call it odoc_support with a way to configure it. Another option would be Rudi's suggestion of having a " _build/doc/$context" which would avoid any name clashes; but that seems to be a modification of grander scope.

@Alizter
Copy link
Collaborator

Alizter commented Apr 20, 2023

Adding a .nojekyll file seems like a good workaround until somebody is actually using jekyll in their gh-pages site. Perhaps a better alternative would be to generate a _config.yml file and explicitly include _odoc_support. This workaround is detailed here:
https://medium.com/@juliakmdev/learning-that-github-pages-struggles-with-certain-file-names-4d867d499ca9

@emillon
Copy link
Collaborator Author

emillon commented Apr 20, 2023

Adding a .nojekyll file seems like a good workaround until somebody is actually using jekyll in their gh-pages site.

When would that be the case? If I understand correctly, the issue is that if you deploy the contents of the docs folder to the root of the gh-pages branch. In that case, you're deploying a static website, there can't be any jekyll in there. Are you thinking of the case where the doc folder is a subdirectory of a gh-pages website? In that case I don't think that _config.yml would be honored.

@jonludlam
Copy link
Member

I'm currently working on a project that would put all the docs currently in _build/default/_doc/_html/xxx into _build/default/_doc/_html/docs/xxx, which means _build/default/_doc/_html/odoc_support is viable. As @Alizter says though, this is bigger in scope and I'm not sure whether this will cause anyone problems. For now, how about odoc.support? or even odoc.assets or similar?

@dbuenzli
Copy link

For now, how about odoc.support? or even odoc.assets or similar?

Of course! I think upstream odoc could simply switch to that.

Fixes ocaml#7364

If the directory is named `_odoc_support` with a leading underscore, it
is omitted when deploying to github pages. This is because this system
also support the jekyll site generator, which uses this convention for
data files.

We can not use any directory name here since we want to avoid conflicts
with OCaml identifiers and names of `*.mld` files.

Signed-off-by: Etienne Millon <[email protected]>
@emillon emillon force-pushed the dot-odoc-support branch from 07d43ad to 7995560 Compare May 2, 2023 13:58
@emillon emillon changed the title odoc: put odoc support files in .odoc_support odoc: put odoc support files in odoc.support May 2, 2023
@emillon emillon merged commit f97fc32 into ocaml:main May 3, 2023
emillon added a commit to emillon/opam-repository that referenced this pull request May 3, 2023
CHANGES:

- Correctly set `MANPATH` in `dune exec`. Previously, we would use the `bin/`
  directory of the context. (ocaml/dune#7655, @rgrinberg)

- Allow overriding the `ocaml` binary with findlib configuration (ocaml/dune#7648,
  @rgrinberg)

- Modules that were declared in `(modules_without_implementation)`,
  `(private_modules)` or `(virtual_modules)` but not declared in `(modules)`
  will cause Dune to emit a warning which will become an error in 3.9. (ocaml/dune#7608,
  fixes ocaml/dune#7026, @Alizter)

- Dune can now detect Coq theories from outside the workspace. This allows for
  composition with installed theories (not necessarily installed with Dune).
  (ocaml/dune#7047, @Alizter, @ejgallego)

- Fix regression where Merlin was unable to handle filenames with uppercase
  letters under Windows. (ocaml/dune#7577, @nojb)

- On nix+macos, pass `-f` to the codesign hook to avoid errors when the binary
  is already signed (ocaml/dune#7183, fixes ocaml/dune#6265, @greedy)

- Fix bug where RPC clients built with dune-rpc-lwt would crash when closing
  their connection to the server (ocaml/dune#7581, @gridbugs)

- Introduce mdx stanza 0.4 requiring mdx >= 2.3.0 which updates the default
  list of files to include `*.mld` files (ocaml/dune#7582, @Leonidas-from-XIV)

- Fix RPC server on Windows (used for OCaml-LSP). (ocaml/dune#7666, @nojb)

- In `(executable)`, `(public_name -)` is now equivalent to no `(public_name)`.
  This is consistent with how `(executables)` handles this field.
  (ocaml/dune#7576 , fixes ocaml/dune#5852, @emillon)

- Change directory of odoc assets to `odoc.support` (was `_odoc_support`) so
  that it works with Github Pages out of the box. (ocaml/dune#7588, fixes ocaml/dune#7364,
  @emillon)
@emillon emillon deleted the dot-odoc-support branch July 25, 2023 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
odoc Issues and PRs related to documentation generation with odoc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad interaction between _odoc_supports directory and github pages / jekyll
4 participants