-
Notifications
You must be signed in to change notification settings - Fork 46
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
Vendor odoc-parser #430
Vendor odoc-parser #430
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.
The update-odoc-parser.sh script will need quite a lot of modifications when upgrading the vendored odoc-parser, but it is still good to keep it!
cp -v $SRC/LICENSE.md odoc-parser/ | ||
|
||
git checkout odoc-parser/src/dune | ||
git add -A . |
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'm not sure, what is this line for?
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.
Which, the git add? I should mention that this script was modelled closely on (copied from!) dune's equilvalent scripts, e.g. https://github.com/ocaml/dune/blob/main/vendor/update-cmdliner.sh
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.
Yes, I was wondering why automatically adding those files to the git index... (I'm OK with it, I just wanted to know if there was a specific reason you knew for 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.
I left comments to update vendor/update-odoc-parser.sh
to make it point to the odoc repo since the parser has been merged back.
Btw would it be possible to use git submodules for all this?
@@ -0,0 +1,26 @@ | |||
#!/bin/bash | |||
|
|||
version=ebfd3b9489e44187da2c67d79a32b6fc1e92bda4 |
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.
version=ebfd3b9489e44187da2c67d79a32b6fc1e92bda4 | |
version=5ac1ffc67ce1b96f5a990fa4902a157a5cdb42d0 |
|
||
( | ||
cd $TMP | ||
git clone https://github.com/ocaml-doc/odoc-parser.git |
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.
git clone https://github.com/ocaml-doc/odoc-parser.git | |
git clone https://github.com/ocaml/odoc.git |
|
||
SRC=$TMP/odoc-parser | ||
|
||
cp -v $SRC/src/*.{ml,mli,mll} odoc-parser/src |
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.
cp -v $SRC/src/*.{ml,mli,mll} odoc-parser/src | |
cp -v $SRC/src/parser/*.{ml,mli,mll} odoc-parser/src |
( | ||
cd $TMP | ||
git clone https://github.com/ocaml-doc/odoc-parser.git | ||
cd odoc-parser |
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.
cd odoc-parser | |
cd odoc |
git checkout $version | ||
) | ||
|
||
SRC=$TMP/odoc-parser |
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.
SRC=$TMP/odoc-parser | |
SRC=$TMP/odoc |
More modification would be needed since the new AST has changed the code block node. Moreover, one would want to use the new syntax for "output of code blocks". Indeed, it would fix a bug where an error in the execution leads to:
which is not valid odoc code. |
I think we should merge this as-is, release a version of mdx, then do the work to upgrade to the new parser API. |
I agree with this plan. |
CHANGES: #### Added - Add `os_type` label to enable/disable based on `Sys.os_type` (realworldocaml/mdx#433, @polytypic) - Make MDX compatible with OCaml 5.1 (realworldocaml/mdx#435, @polytypic and @kit-ty-kate) #### Changed - Vendored the odoc-parser library, removing the need to have it as a dependency. (realworldocaml/mdx#430, @jonludlam)
I had a look at it, did I miss something regarding the new syntax for the output of code blocks? this is not mentioned in the docs |
More info is available here: ocaml-doc/odoc-parser#17 I don't know if the new syntax is documented in doco |
CHANGES: #### Added - Add `os_type` label to enable/disable based on `Sys.os_type` (realworldocaml/mdx#433, @polytypic) - Make MDX compatible with OCaml 5.1 (realworldocaml/mdx#435, @polytypic and @kit-ty-kate) #### Changed - Vendored the odoc-parser library, removing the need to have it as a dependency. (realworldocaml/mdx#430, @jonludlam)
This PR vendors odoc-parser into the repo. This helps prevent the use of mdx in odoc's tests. In this I've vendored the latest release of odoc-parser, but once ocaml/odoc#973 is merged we'll want to adjust the script to point at the odoc repo rather than the odoc-parser repo.