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

Driver: allow overriding main package index #1280

Merged
merged 3 commits into from
Jan 17, 2025

Conversation

jonludlam
Copy link
Member

No description provided.

Copy link
Collaborator

@Julow Julow left a comment

Choose a reason for hiding this comment

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

What is the usecase of this page ?

@@ -1,5 +1,18 @@
type u = unit
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the point of this ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Odoc_unit exposes a type 'unit' that's not ()! Perhaps I should just fix that in this PR, and avoid this mess.

| Error (`Msg msg) ->
Logs.err (fun m ->
m "Failed to read index_mld file '%a': %s" Fpath.pp index_mld msg);
[]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Return no pages, not even the pkgs pages ? I think the driver could abort with an exception instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, I think what I'll do is move the load logic into odoc_driver.ml. The problem is that by the time we get here we've done a load of work and I didn't want to just exit. Something something sunk cost... :-)

@@ -1,6 +1,6 @@
open Odoc_unit

type indices_style = Voodoo | Normal | Automatic
type indices_style = Voodoo | Normal of Fpath.t option | Automatic
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be nice to document Normal's arguments, or perhaps use an inline record.

?index:index ->
enable_warnings:bool ->
content:(Format.formatter -> u) ->
u ->
Copy link
Collaborator

Choose a reason for hiding this comment

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

The last unit argument is unnecessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

it was there because all the args are either optional or named. I've removed it and made all args named now.

@jonludlam
Copy link
Member Author

What is the usecase of this page ?

This is the main index page - the one that ends up in _html/index.html.

@Julow
Copy link
Collaborator

Julow commented Jan 17, 2025

This is the main index page - the one that ends up in _html/index.html.

Sorry, I meant what the users will put there ? If the package list page is not desired, what could users do better in Odoc syntax ? I'd expect people to want to integrate this page in their website, and this isn't helping.

@jonludlam
Copy link
Member Author

Well, if you're trying to produce a site documenting multiple packages, like we might well do for odoc, then the autogenerated page is not particularly great. This gives a way to have a front page that can be customized as you see fit.

@jonludlam jonludlam added the no changelog This pull request does not need a changelog entry label Jan 17, 2025
@jonludlam jonludlam merged commit 49837d8 into ocaml:master Jan 17, 2025
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog This pull request does not need a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants