-
Notifications
You must be signed in to change notification settings - Fork 415
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 odoc syntax support #1397
Add odoc syntax support #1397
Conversation
Signed-off-by: Patrick Stapfer <[email protected]>
bf7655e
to
86698ed
Compare
let decode = | ||
enum [ "reason", Reason | ||
; "ocaml", OCaml | ||
; "re", Reason |
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.
I think that "reason" & "ocaml" are enough. These names are also used in formatting rules for examples.
@@ -1894,20 +1893,34 @@ module Copy_files = struct | |||
end | |||
|
|||
module Documentation = struct | |||
module Doc_Syntax = struct | |||
type t = Reason | OCaml | All |
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.
Other places use something like All | Only of syntax list
which is more flexible - with this type you can not only enable a subset, it's all or only one. But this is not a problem since there are only two languages here.
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.
I realized that All
doesn't make sense anyways. odoc
plans to provide both formats within the same html file, so the syntax option is only for the "preferred default syntax" later on
Currently I am having troubles with the fact that there might be multiple After some discussion with @rgrinberg on Discord, one way to tackle this is to configure the odoc syntax flag via an Generally speaking, after ocaml/odoc#129 is resolved, we might only need this flag for selecting a default syntax, but all RE / ML representations should be inlined in the docs and selectable in the UI anyways. \cc @aantron |
I'm wondering where is the best place to put this parameter. It seems more like a user preference to me, i.e. something that should live in |
@diml so my motivation behind this is following UX perspective: I am a Reason library designer and want to use If you don't provide any flag, it will default to OCaml. Generating the docs should IMO be reproducible, so I would not like to see user-based configuration mixed in. There were some concerns that we should also offer a way to expose only one single syntax, so let's wait until ocaml/odoc#129 is resolved. |
I agree that this should be reproductible, similarly to formatting rules not pulling global configuration. |
I see, thanks for the explanation. In general, I assume that the developer will make this choice once for a given project, maybe it should go in the |
Also, one should note that there has been no release of |
Hmm, actually I agreed with your original point that it's probably more useful as a user preference for users of the package rather than the developers.
@aantron gave us a warning that there should be a new odoc release this week. |
Indeed, btw I just remembered one question i had about this: if you are using a mix of OCaml and Reason libraries, do you expect to read the doc for OCaml libraries in OCaml syntax and the doc for Reason libraries in Reason syntax? If yes, then there should indeed be a configuration parameter in dune about this. If not, i.e. you want to read everything in the same syntax, then it feels like a runtime configuration parameter is better suited. Dune doesn't need to know about the latter. |
Closing for staleness. Feel free to re-open once you are ready to make more progress. |
This is a tracking branch for #1117
Things which need to be done:
documentation
stanza