Expose parser internals and add Parser.parse_comment_raw#351
Expose parser internals and add Parser.parse_comment_raw#351aantron merged 1 commit intoocaml:masterfrom
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_contentand 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_.Astis a bit simpler thanModel.Commentand a lot simpler to obtain.It also contains more informations (eg. heading labels)
I also add
Parser.parse_comment_rawthat returns anAst.docs.