Skip to content

Add documentation on hyperlinks #124

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

Merged
merged 2 commits into from
Oct 24, 2017
Merged

Add documentation on hyperlinks #124

merged 2 commits into from
Oct 24, 2017

Conversation

weaverba137
Copy link
Contributor

This PR fixes #116 by adding documentation on how to handle hyperlink targets in docstrings.

doc/format.rst Outdated
``WARNING: Unknown target name: "example"``, then that is what is happening.
There are two possible workarounds. First, the inline form can be used::

`Example <http://www.example.com>`_
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be `Example <http://www.example.com`__ ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure that inline hyperlink targets need a closing > and one underscore, not two. Please see http://docutils.sourceforge.net/docs/user/rst/quickref.html#hyperlink-targets

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The missing > was a typo; I was concerned with what happens when you have similar inline references in different docstrings.

doc/format.rst Outdated

`Example <http://www.example.com>`_

Second, the hyperlink target can be placed in a section that *is* parsed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we only recommend a version that will always work; if we choose to parse the Notes section differently later on, this may break. Others may disagree; I don't feel strongly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm OK with that.

@jnothman
Copy link
Member

Thanks @weaverba137

@jnothman jnothman merged commit f901007 into numpy:master Oct 24, 2017
@weaverba137 weaverba137 deleted the rest-links branch April 6, 2018 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Links in docstrings are broken
3 participants