Skip to content

Conversation

Octachron
Copy link
Member

In the latex backend, inlining all submodule and functor definitions in their long form is not always the optimal choice.
In particular, it can be better to be more concise and use only the short description for nested submodules

This PR adds a flag --shorten-beyond-depth to the latex backend to make it choose the abbreviated form
for submodules beyond a given depth.

Along the way, this PR fixes a collision between page url and anchor and adds missing label definitions for pages that have been inlined in the current page in order to redirect references to those page toward the inlined contents.

Combined with an option to remove link to functor arguments, this seems enough to remove all missing labels warning from the build of the reference manual.

@jonludlam jonludlam force-pushed the odoc_latex_shorten_submodules branch from 56e2c14 to ac16f2c Compare July 4, 2025 12:50
@Octachron
Copy link
Member Author

@jonludlam , would you prefer to me to add a Changes entry with the initial PR?

By default, I tend to add it once the PR has been reviewed, but switching to an optimist mode for the Changes entry is fine with me.

@jonludlam
Copy link
Member

I don't particularly mind when it's added - but since this has been languishing for ages without being looked at, I thought I wouldn't then send it back because it didn't have CHANGES :-) Sorry it's been so long! It looks fine though, so as soon as the tests are all passing, in it goes!

@jonludlam jonludlam merged commit 4daca5b into ocaml:master Jul 4, 2025
10 of 12 checks passed
jonludlam added a commit to jonludlam/opam-repository that referenced this pull request Jul 10, 2025
CHANGES:

### Added
- Exposed sherlodoc libraries for use in other projects (@jonludlam, ocaml/odoc#1349)
- OCaml 5.4.0 support (@Octachron, ocaml/odoc#1355)
- New arguments to LaTeX generator, --shorten-beyond-depth and
  --remove-functor-arg-link (@Octachron, ocaml/odoc#1337)
- New experimental markdown generator (@davesnx, ocaml/odoc#1341)

### Changed
- Remove cmdliner compatibility layer, no longer needed (@dbuenzli, ocaml/odoc#1328)
- Drop support for OCaml < 4.08 (@jonludlam, ocaml/odoc#1300)
- Allow referencing libraries from package added in `odoc-config.sexp`
  (@panglesd, ocaml/odoc#1343)
- Use full path in heading labels in LaTeX backend (@Octachron, ocaml/odoc#1332)
- Separate page from anchor in LaTeX labels to prevent collisions (@Octachron,
  ocaml/odoc#1337)

### Fixed
- Fix bug in parsing META files when there are no dependencies (@jonludlam, ocaml/odoc#1352)
- Fix ocaml/odoc#1335 - incorrect rendering when on medium screen size with no global
  sidebar (@lukemaurer, ocaml/odoc#1361)
- Fixed generation of occurrences for docs CI (@jonludlam, ocaml/odoc#1362)
jonludlam added a commit to jonludlam/opam-repository that referenced this pull request Jul 10, 2025
CHANGES:

- Exposed sherlodoc libraries for use in other projects (@jonludlam, ocaml/odoc#1349)
- OCaml 5.4.0 support (@Octachron, ocaml/odoc#1355)
- New arguments to LaTeX generator, --shorten-beyond-depth and
  --remove-functor-arg-link (@Octachron, ocaml/odoc#1337)
- New experimental markdown generator (@davesnx, ocaml/odoc#1341)

- Remove cmdliner compatibility layer, no longer needed (@dbuenzli, ocaml/odoc#1328)
- Drop support for OCaml < 4.08 (@jonludlam, ocaml/odoc#1300)
- Allow referencing libraries from package added in `odoc-config.sexp`
  (@panglesd, ocaml/odoc#1343)
- Use full path in heading labels in LaTeX backend (@Octachron, ocaml/odoc#1332)
- Separate page from anchor in LaTeX labels to prevent collisions (@Octachron,
  ocaml/odoc#1337)

- Fix bug in parsing META files when there are no dependencies (@jonludlam, ocaml/odoc#1352)
- Fix ocaml/odoc#1335 - incorrect rendering when on medium screen size with no global
  sidebar (@lukemaurer, ocaml/odoc#1361)
- Fixed generation of occurrences for docs CI (@jonludlam, ocaml/odoc#1362)
jonludlam added a commit to jonludlam/opam-repository that referenced this pull request Jul 15, 2025
CHANGES:

### Added
- Exposed sherlodoc libraries for use in other projects (@jonludlam, ocaml/odoc#1349)
- OCaml 5.4.0 support (@Octachron, ocaml/odoc#1355)
- New arguments to LaTeX generator, --shorten-beyond-depth and
  --remove-functor-arg-link (@Octachron, ocaml/odoc#1337)
- New experimental markdown generator (@davesnx, ocaml/odoc#1341)

### Changed
- Remove cmdliner compatibility layer, no longer needed (@dbuenzli, ocaml/odoc#1328)
- Drop support for OCaml < 4.08 (@jonludlam, ocaml/odoc#1300)
- Allow referencing libraries from package added in `odoc-config.sexp`
  (@panglesd, ocaml/odoc#1343)
- Use full path in heading labels in LaTeX backend (@Octachron, ocaml/odoc#1332)
- Separate page from anchor in LaTeX labels to prevent collisions (@Octachron,
  ocaml/odoc#1337)

### Fixed
- Fix bug in parsing META files when there are no dependencies (@jonludlam, ocaml/odoc#1352)
- Fix ocaml/odoc#1335 - incorrect rendering when on medium screen size with no global
  sidebar (@lukemaurer, ocaml/odoc#1361)
- Fixed generation of occurrences for docs CI (@jonludlam, ocaml/odoc#1362)
- Partial fix for ocaml/odoc#1369 - ensure that we never create a link to a hidden page
  (@jonludlam, ocaml/odoc#1370)
jonludlam added a commit to jonludlam/opam-repository that referenced this pull request Jul 15, 2025
CHANGES:

- Exposed sherlodoc libraries for use in other projects (@jonludlam, ocaml/odoc#1349)
- OCaml 5.4.0 support (@Octachron, ocaml/odoc#1355)
- New arguments to LaTeX generator, --shorten-beyond-depth and
  --remove-functor-arg-link (@Octachron, ocaml/odoc#1337)
- New experimental markdown generator (@davesnx, ocaml/odoc#1341)

- Remove cmdliner compatibility layer, no longer needed (@dbuenzli, ocaml/odoc#1328)
- Drop support for OCaml < 4.08 (@jonludlam, ocaml/odoc#1300)
- Allow referencing libraries from package added in `odoc-config.sexp`
  (@panglesd, ocaml/odoc#1343)
- Use full path in heading labels in LaTeX backend (@Octachron, ocaml/odoc#1332)
- Separate page from anchor in LaTeX labels to prevent collisions (@Octachron,
  ocaml/odoc#1337)

- Fix bug in parsing META files when there are no dependencies (@jonludlam, ocaml/odoc#1352)
- Fix ocaml/odoc#1335 - incorrect rendering when on medium screen size with no global
  sidebar (@lukemaurer, ocaml/odoc#1361)
- Fixed generation of occurrences for docs CI (@jonludlam, ocaml/odoc#1362)
- Partial fix for ocaml/odoc#1369 - ensure that we never create a link to a hidden page
  (@jonludlam, ocaml/odoc#1370)
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

Successfully merging this pull request may close these issues.

2 participants