Skip to content

Expand documentation linking in CONTRIBUTING.md - #802

Merged
seisman merged 28 commits into
GenericMappingTools:masterfrom
willschlitzer:contributing-links
Mar 2, 2021
Merged

seisman merged 28 commits into
GenericMappingTools:masterfrom
willschlitzer:contributing-links

Conversation

@willschlitzer

@willschlitzer willschlitzer commented Jan 23, 2021 •

Copy link
Copy Markdown
Contributor

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

@willschlitzer

Copy link
Copy Markdown
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

michaelgrund commented Jan 23, 2021 •

Copy link
Copy Markdown
Member

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

seisman commented Jan 29, 2021

Copy link
Copy Markdown
Member

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

@willschlitzer

Copy link
Copy Markdown
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

seisman commented Jan 29, 2021

Copy link
Copy Markdown
Member

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.

Comment thread CONTRIBUTING.md Resolved
Comment thread CONTRIBUTING.md Resolved
@seisman

seisman commented Feb 20, 2021

Copy link
Copy Markdown
Member

@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

seisman commented Feb 20, 2021

Copy link
Copy Markdown
Member

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.

Comment thread CONTRIBUTING.md Resolved
Co-authored-by: Dongdong Tian <[email protected]>
Comment thread CONTRIBUTING.md Resolved
Comment thread CONTRIBUTING.md Resolved
Co-authored-by: Dongdong Tian <[email protected]>
Co-authored-by: Wei Ji <[email protected]>
Comment thread CONTRIBUTING.md Resolved
@vercel

vercel Bot commented Mar 1, 2021

Copy link
Copy Markdown

@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 <[email protected]>
Co-authored-by: Meghan Jones <[email protected]>
Co-authored-by: Wei Ji <[email protected]>

This branch was previously deployed

1 inactive deployment
Preview — 19a22414 Deployed Mar 2, 2021 by vercel[bot]
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