-
Notifications
You must be signed in to change notification settings - Fork 90
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
Expose parser internals and add Parser.parse_comment_raw #351
Conversation
What would make
I suggest to retain any information you need in |
By simpler I meant it's no longer needed to construct the I'm using Odoc in OCamlformat to reformat documentation comments. Currently, Odoc is quite hard to use and I'd like to improve this. |
Ah, having to build a dummy argument to the function is definitely something we should fix. I'm not quite sure I follow the argument about exposing |
The problem with heading labels is that they are not optional in |
We could put the original text in the reference tag: `Reference of Reference.t * string * link_content and mark the headers with whether the label was generated or specified? It doesn't seem totally unreasonable to me that ocamlformat only formats valid ocamldoc markup, to be honest, so long as we can surface the warnings to the user. It's a bit of an incentive to write the docs correctly :-) |
Closing this PR, as I believe the discussion in #355 supersedes it. |
Thanks for the reopen ! I rebased on master and changed the way the AST is exposed. |
Looks good. Thanks for your patience and initiative! |
Thanks ! |
This PR exposes the internal modules of the parser.
I figured that
Parser_.Ast
is a bit simpler thanModel.Comment
and a lot simpler to obtain.It also contains more informations (eg. heading labels)
I also add
Parser.parse_comment_raw
that returns anAst.docs
.