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

Add a source-root arg to html-generate #982

Merged
merged 2 commits into from
Sep 18, 2023

Conversation

jonludlam
Copy link
Member

The relative path has already been given when the .cmt was originally compiled, so to avoid having to pass it again this argument allows the root directory of the source tree to be passed, and then odoc finds the actual source file by looking up that relative file within the tree.

The relative path has already been given when the .cmt was originally compiled,
so to avoid having to pass it again this argument allows the root directory of
the source tree to be passed, and then odoc finds the actual source file by
looking up that relative file within the tree.
Copy link
Collaborator

@panglesd panglesd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Comment on lines 19 to 26
type source = File of Fpath.t | Root of Fpath.t

let pp fmt = function
| File f -> Format.fprintf fmt "File: %a" Fpath.pp f
| Root f -> Format.fprintf fmt "File: %a" Fpath.pp f

let to_string f = Format.asprintf "%a" pp f

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this could be put inside a submodule? The Html_page.to_string and Html_page.pp names can be misleading, as they are not function dealing with "html pages"...

Comment on lines 735 to 736
"Source code root for the compilation unit. It must have been compiled \
with --source-parent passed."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel it might help to add some explanation what is a "source code root".

Suggested change
"Source code root for the compilation unit. It must have been compiled \
with --source-parent passed."
"Source code root for the compilation unit. Used to find the source file \
from the value of --source-name it was compiled with. Incompatible with \
--source-file."

Also, line 718 it should be --source-parent-file instead of --source-parent (or maybe "--source-parent-file and --source-name to be more explicit)

@jonludlam
Copy link
Member Author

Thanks @panglesd - applied.

@jonludlam jonludlam merged commit 5ac1ffc into ocaml:master Sep 18, 2023
3 of 4 checks passed
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