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

Expand documentation linking in CONTRIBUTING.md #802

Merged
merged 28 commits into from
Mar 2, 2021

Conversation

willschlitzer
Copy link
Contributor

@willschlitzer willschlitzer commented Jan 23, 2021

This PR adds an explanation for linking PyGMT methods and GMT documentation using the Sphinx build in the contributing guide.

@willschlitzer
Copy link
Contributor Author

I regularly find myself having to look through files I've previously worked on to remind myself how to link to PyGMT and GMT pages, and think it is used enough to be added to the contributing guide. A few questions before I mark this ready for review:

  1. How do I link to a generic PyGMT documentation (such as a tutorial or gallery page) page in the Sphinx build? I would like to include that as well.
  2. Should the contributing guide include some examples of links? Someone may be confused by how to modify something like :class:package.module.class to be usable, but understand that something like :meth:pygmt.Figure.grdcontour links to grdconour and only requires minor modification to link to where they want.

@michaelgrund
Copy link
Member

michaelgrund commented Jan 23, 2021

I regularly find myself having to look through files I've previously worked on to remind myself how to link to PyGMT and GMT pages, and think it is used enough to be added to the contributing guide. A few questions before I mark this ready for review:

1. How do I link to a generic PyGMT documentation (such as a tutorial or gallery page) page in the Sphinx build? I would like to include that as well.

2. Should the contributing guide include some examples of links? Someone may be confused by how to modify something like `` :class:`package.module.class` `` to be usable, but understand that something like `` :meth:`pygmt.Figure.grdcontour` `` links to grdconour and only requires minor modification to link to where they want.

Great idea, recently came exactly across the issues you mentioned @willschlitzer , especially how to format links that they are displayed correctly (or really point to the desired page/subpoint).

@seisman seisman added the maintenance Boring but important stuff for the core devs label Jan 23, 2021
@seisman seisman added this to the 0.3.0 milestone Jan 23, 2021
@seisman
Copy link
Member

seisman commented Jan 29, 2021

@willschlitzer This PR looks good. Is it ready for review (and merge)?

@willschlitzer
Copy link
Contributor Author

@seisman How do I link to other pygmt pages in the same way we can link to GMT docs? I know you've told me in the past, but I was going through old PRs and couldn't find it.

Also, I think the contributing guide should have example links in addition to the formats; do you think that's a good idea?

@seisman
Copy link
Member

seisman commented Jan 29, 2021

How do I link to other pygmt pages in the same way we can link to GMT docs? I know you've told me in the past, but I was going through old PRs and couldn't find it.

You can link to a file, using

:doc:`Any Link Text </path/to/the/file>`

For example, :doc:Install instructions </install> links to https://www.pygmt.org/dev/install.html

I think the contributing guide should have example links in addition to the formats; do you think that's a good idea?

Yes, that would be better.

CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
@seisman
Copy link
Member

seisman commented Feb 20, 2021

@willschlitzer Don't forget @weiji14's #802 (comment)

There's also :gmt-term: linking to gmt.conf. See e.g.

:gmt-term:`COLOR_FOREGROUND`, and :gmt-term:`COLOR_NAN` from the

@seisman
Copy link
Member

seisman commented Feb 20, 2021

See https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#cross-referencing-syntax

If you prefix the content with ~, the link text will only be the last component of the target. For example, :py:meth:`~Queue.Queue.get` will refer to Queue.Queue.get but only display get as the link text.

We're not using ~ in the documentation. Is it useful? If it is, we should also document it.

Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
CONTRIBUTING.md Outdated Show resolved Hide resolved
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
CONTRIBUTING.md Outdated Show resolved Hide resolved
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
@vercel
Copy link

vercel bot commented Mar 1, 2021

@willschlitzer is attempting to deploy a commit to the Generic Mapping Tools Team on Vercel.

A member of the Team first needs to authorize it.

@seisman seisman changed the title Expanding documentation linking in CONTRIBUTING.md Expand documentation linking in CONTRIBUTING.md Mar 2, 2021
@seisman seisman merged commit a4a3721 into GenericMappingTools:master Mar 2, 2021
@willschlitzer willschlitzer deleted the contributing-links branch March 2, 2021 21:27
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
)

Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Meghan Jones <meghanj@alum.mit.edu>
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants