Skip to content
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

Generate links to exception definitions referenced in @raise tags #6254

Closed
vicuna opened this issue Dec 1, 2013 · 2 comments
Closed

Generate links to exception definitions referenced in @raise tags #6254

vicuna opened this issue Dec 1, 2013 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Dec 1, 2013

Original bug ID: 6254
Reporter: jtoman
Assigned to: @zoggy
Status: assigned (set by jtoman on 2013-12-01T06:42:07Z)
Resolution: open
Severity: feature
Category: ocamldoc
Tags: patch

Bug description

It would be nice if the Ocamldoc tool automatically generated links to exceptions referenced in doc comments via the @raise tag.

Attached are two patches that contain potential starting points for this feature (both of which have been applied against trunk).

About these patches:
Both add a new option to ocamldoc, -link-raise which will, when possible, generate cross links between exceptions referenced in @raise comments and their definition. If the cross referencing is impossible due to limitations on the output format (or a cross reference wasn't found) the old style comments are generated instead.

The first approach, link_raise_field.patch, adds a new option field to the raised_exception type. A value of "None" for this field indicates no cross-reference was found (or the user did not opt into cross-referencing). A value of "Some path" indicates the reference exception was found and the string path is a fully qualified path which can be used to generate a link. This approach will break any custom generators and required touching more code.

The second approach, link_raise_bc.patch adds a new field, i_linked_exc which is an associative list mapping the exception name in i_raised_exc to it's full path (for linking). The absence of an exception from the link indicates that no cross-reference was found, or that the user did not opt-into the cross-referencing. This approach was more backwards compatible with existing code, hence the name.

File attachments

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@avsm
Copy link
Member

avsm commented Jun 17, 2020

I've filed this on the odoc tracker at ocaml/odoc#440

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants