-
Notifications
You must be signed in to change notification settings - Fork 100
Allow more hierarchy to be compatible with -L
and -P
.
#1233
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
Merged
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
bf5ab02
Hierarchies: Weaken constraints on -L and -P
panglesd 5d937aa
Hierarchy: update test to use the "canonical hierarchy"
panglesd 4a0f843
Test: Move sidebar to a more logical directory
panglesd 836c324
Test: canonical hierarchy
panglesd 2ff3cc1
Test: hierarchy with separate `doc` and `lib` folders
panglesd 6d7db98
Small refactor of Antichain.check
panglesd 79c3ca6
Test: improve link_opts test readability
panglesd 9bf48e1
Test: Add more sidebar test
panglesd 861a2c0
Exclude -L subfolders from -P roots
panglesd 7eedbc8
Fix misleading name
panglesd ebb4689
Use `Odoc_utils` for `List.find_map` compat.
panglesd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,61 @@ | ||
$ ocamlc -bin-annot test.ml | ||
$ mkdir h | ||
$ odoc compile --output-dir h --parent-id pkg/doc page.mld | ||
$ odoc compile --output-dir h --parent-id pkg/lib/libname test.cmt | ||
$ odoc compile --output-dir h --parent-id pkg page.mld | ||
$ odoc compile --output-dir h --parent-id pkg/libname test.cmt | ||
|
||
No library or package are passed, no error. This ensures compatibility with Odoc 2. | ||
No -P or -L passed, no error. This ensures compatibility with Odoc 2. | ||
|
||
$ odoc link -P pkg:h/pkg/doc h/pkg/lib/libname/test.odoc | ||
$ odoc link -P pkg:h/pkg/doc h/pkg/doc/page-page.odoc | ||
$ odoc link -L libname:h/pkg/lib/libname h/pkg/lib/libname/test.odoc | ||
$ odoc link -L libname:h/pkg/lib/libname h/pkg/doc/page-page.odoc | ||
$ odoc link h/pkg/libname/test.odoc | ||
$ odoc link h/pkg/page-page.odoc | ||
$ odoc link h/pkg/libname/test.odoc | ||
$ odoc link h/pkg/page-page.odoc | ||
|
||
Current library is not passed: | ||
The correct -P and -L will be used several times, we store them to make it more readable. | ||
|
||
$ odoc link -P pkg:h/pkg/doc -L otherlib:h/otherpkg h/pkg/lib/libname/test.odoc | ||
ERROR: The input file must be part of a directory passed as -L | ||
[1] | ||
$ odoc link -P pkg:h/pkg/doc -L otherlib:h/otherpkg h/pkg/doc/page-page.odoc | ||
$ P="-P pkg:h/pkg" | ||
$ L="-L libname:h/pkg/libname" | ||
|
||
Current package is not passed: | ||
Including all options: | ||
|
||
$ odoc link -P otherpkg:h/otherpkg/doc -L libname:h/pkg/lib/libname h/pkg/lib/libname/test.odoc | ||
$ odoc link -P otherpkg:h/otherpkg/doc -L libname:h/pkg/lib/libname h/pkg/doc/page-page.odoc | ||
ERROR: The input file must be part of a directory passed as -P | ||
[1] | ||
$ odoc link $P $L h/pkg/libname/test.odoc | ||
$ odoc link $P $L h/pkg/page-page.odoc | ||
|
||
A package can be passed, either with `--current-package` or by being below a | ||
`-P`. | ||
|
||
For modules: | ||
|
||
$ odoc link -P pkg:h/pkg2 $L h/pkg/libname/test.odoc --current-package pkg | ||
$ odoc link $P $L h/pkg/libname/test.odoc | ||
|
||
For pages: | ||
|
||
$ odoc link -P pkg:h/pkg2 $L h/pkg/page-page.odoc --current-package pkg | ||
$ odoc link $P $L h/pkg/page-page.odoc | ||
|
||
Specified current package is wrong: | ||
It is not required to be below a `-L`, even for modules: | ||
|
||
$ odoc link --current-package wrong -P pkg:h/pkg/doc -L libname:h/pkg/lib/libname h/pkg/lib/libname/test.odoc | ||
$ odoc link $P -L otherlib:h/otherpkg/otherlib h/pkg/libname/test.odoc | ||
|
||
For both pages and modules, --current-package has to correspond to a -P: | ||
|
||
$ odoc link --current-package wrong -P pkg:h/pkg2 $L h/pkg/libname/test.odoc | ||
ERROR: The package name specified with --current-package do not match any package passed as a -P | ||
[1] | ||
$ odoc link --current-package wrong -P pkg:h/pkg/doc -L libname:h/pkg/lib/libname h/pkg/doc/page-page.odoc | ||
$ odoc link --current-package wrong h/pkg/page-page.odoc | ||
ERROR: The package name specified with --current-package do not match any package passed as a -P | ||
[1] | ||
|
||
Specified current package is inconsistent: | ||
For both pages and modules, --current-package has to correspond to the same -P as the one that is a root of the page, when there is one: | ||
|
||
$ odoc link --current-package otherpkg -P pkg:h/pkg/doc -P otherpkg:h/otherpkg/doc -L libname:h/pkg/lib/libname h/pkg/lib/libname/test.odoc | ||
$ odoc link --current-package otherpkg -P pkg:h/pkg/doc -P otherpkg:h/otherpkg/doc -L libname:h/pkg/lib/libname h/pkg/doc/page-page.odoc | ||
$ odoc link --current-package wrong $P $L h/pkg/page-page.odoc | ||
ERROR: The package name specified with --current-package is not consistent with the packages passed as a -P | ||
[1] | ||
$ odoc link --current-package otherpkg $P -P otherpkg:h/otherpkg $L h/pkg/page-page.odoc | ||
ERROR: The package name specified with --current-package is not consistent with the packages passed as a -P | ||
[1] | ||
|
||
Packages and libraries overlap: | ||
Packages and libraries overlap do not pose a problem: | ||
|
||
$ odoc link -P pkg:h/pkg/doc -P otherpkg:h/pkg/lib/libname -L libname:h/pkg/lib/libname h/pkg/lib/libname/test.odoc | ||
ERROR: Arguments given to -P and -L cannot be included in each others | ||
[1] | ||
$ odoc link -P pkg:h/pkg/doc -P otherpkg:h/pkg/lib/libname -L libname:h/pkg/lib/libname h/pkg/doc/page-page.odoc | ||
ERROR: Arguments given to -P and -L cannot be included in each others | ||
[1] | ||
$ odoc link $P $L h/pkg/libname/test.odoc | ||
$ odoc link $P $L h/pkg/page-page.odoc |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way
find_map
is inOdoc_utils.List