-
Notifications
You must be signed in to change notification settings - Fork 94
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
Conversation
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.
What is the usecase of this page ?
src/driver/landing_pages.mli
Outdated
@@ -1,5 +1,18 @@ | |||
type u = unit |
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.
What is the point of this ?
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.
Odoc_unit exposes a type 'unit' that's not ()
! Perhaps I should just fix that in this PR, and avoid this mess.
src/driver/odoc_units_of.ml
Outdated
| Error (`Msg msg) -> | ||
Logs.err (fun m -> | ||
m "Failed to read index_mld file '%a': %s" Fpath.pp index_mld msg); | ||
[] |
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.
Return no pages, not even the pkgs pages ? I think the driver could abort with an exception instead.
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.
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... :-)
src/driver/odoc_units_of.mli
Outdated
@@ -1,6 +1,6 @@ | |||
open Odoc_unit | |||
|
|||
type indices_style = Voodoo | Normal | Automatic | |||
type indices_style = Voodoo | Normal of Fpath.t option | Automatic |
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.
It would be nice to document Normal's arguments, or perhaps use an inline record.
src/driver/landing_pages.mli
Outdated
?index:index -> | ||
enable_warnings:bool -> | ||
content:(Format.formatter -> u) -> | ||
u -> |
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.
The last unit argument is unnecessary.
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.
it was there because all the args are either optional or named. I've removed it and made all args named now.
This is the main index page - the one that ends up in |
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. |
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. |
No description provided.