-
Notifications
You must be signed in to change notification settings - Fork 88
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
Support BuckleScript (Backport to 4.02.3) #179
Conversation
IIRC there were quite a few bugs with |
@dbuenzli I wasn't suggesting that this should be merged 🙈 — if anything I said the opposite:
And I'm more than happy to maintain the backport until BuckleScript moves out of 4.02.x 😄 — I was just looking for some guidance. Would it be worth publishing under a different name? |
My answers:
Regarding Fira Code, we can put it into the font stack in CSS, so it is used if available. I use this font myself, it is nice :) And I agree with emitting markup that fonts will have ligatures for. My suggestion is to take the Fira Code commit out of this PR, and open a separate PR for it. We can merge that right away. For the 4.02 port, I suggest using cppo (and maybe It may be worthwhile to create a new At least for module String =
struct
include String
let capitalize s = (capitalize [@ocaml.warning "-3"]) s
end and |
e824efb
to
ef01e14
Compare
@aantron refactored to include a Could use some pointers updating the tests too. |
15d6065
to
65bd138
Compare
src/odoc/env.ml
Outdated
@@ -35,7 +37,7 @@ module Accessible_paths = struct | |||
|
|||
let find_file_by_name t name = | |||
let uname = name ^ ".odoc" in | |||
let lname = String.uncapitalize_ascii name ^ ".odoc" in | |||
let lname = String.uncapitalize name ^ ".odoc" in |
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.
Total nit, but I recommend calling these functions in Compat.String
by their 4.03 names (uncapitalize_ascii
, etc.), so we can later just delete that module and open Compat
, and not have to edit the rest of the code.
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.
Makes sense!
src/loader/cmi.ml
Outdated
@@ -524,12 +541,18 @@ let read_label_declaration env parent ld = | |||
let type_ = read_type_expr env ld.ld_type in | |||
{id; doc; mutable_; type_} | |||
|
|||
let read_constructor_declaration_arguments env parent arg = | |||
let read_constructor_declaration_arguments env _parent arg = |
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.
Looks like _parent
should be restored back to parent
, since it's used in the 4.03 code. I recommend adding ignore parent;
to the 4.02 code to suppress the warning.
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.
Fixed 🆗
src/loader/cmti.ml
Outdated
@@ -160,12 +160,16 @@ let read_label_declaration env parent ld = | |||
let type_ = read_core_type env ld.ld_type in | |||
{id; doc; mutable_; type_} | |||
|
|||
let read_constructor_declaration_arguments env parent arg = | |||
let read_constructor_declaration_arguments env _parent arg = |
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.
Same thing with _parent
, suggest ignore parent;
in 4.02 code.
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.
Fixed 🆗
330011d
to
da65fd8
Compare
@aantron @rizo this is what I came up with: da65fd8#diff-19c336c256d025411f1aa0f1b03f19a2R55 It wasn't really a labelling problem, but rather that the Happy to refactor as you may see fit so just let me know. |
LGTM. I have two requests:
|
da65fd8
to
969bcde
Compare
@aantron had to rebase because of the merge-conflict, but added the following changes in new commits for easier review 👍 Also let me know what do you think about the README additions! |
The README looks good. Thank you! |
In order to support BuckleScript in it's current release, I set up to backport
odoc
to support the 4.02.x switches. I'm opening this PR as a WIP to gather feedback, ideas, thoughts. Not really a PR to get merged.The changes aren't too big, just pulling in the
result
module and making some decision on how to handle the old AST. So far there's only 4 tests that fail — if I read the output ofmake test
correctly 😅@rizo suggested using
migrate-parse-tree
, which I'll have a look at later today.I'm also making a small change in the HTML outputter so it uses regular dashes
-
instead of short ones‑
— it's barely perceptible to the naked eye, but a font with ligatures (such asFira Code
) can't apply them otherwise (left is replaced, right is the current output):I wouldn't go as far as making
FiraCode
the default font (not everyone likes ligatures) but it should be an easy drop-in.Sample Generated Docs: ostera/reactor — there's some wonkyness with the links but it's a start.
Anyway! Got a few questions that arose while working on this if anyone feels like chiming in 🤔
odoc
support BuckleScript at all?migrate-parse-tree
)Thanks to the maintainers for this wonderful tool and looking forward to have a single documentation tool that spans OCaml dialects and compilers 🙌