Skip to content

Conversation

@yvonnefroehlich
Copy link
Member

Description of proposed changes

This PR aims to update the link to the upstream GMT documentation "Chart of Octal Codes for Characters", as cookbook was renamed to reference in the GMT PR GenericMappingTools/gmt#7786.

Fixes #2679

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • If adding new functionality, add an example to docstrings or tutorials.
  • Use underscores (not hyphens) in names of Python files and directories.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@yvonnefroehlich yvonnefroehlich added documentation Improvements or additions to documentation skip-changelog Skip adding Pull Request to changelog labels Sep 10, 2023
@yvonnefroehlich yvonnefroehlich added this to the 0.11.0 milestone Sep 10, 2023
@yvonnefroehlich
Copy link
Member Author

Due to the renaming from cookbook to reference in the upstream GMT documentation (see GMT PR GenericMappingTools/gmt#7786), we will have to update several occurrences in the PyGMT documentation when GMT 6.5.0 is released:

Admin@XXXXXX */pygmt/pygmt/src
$ grep "cookbook" *
grd2cpt.py:    :gmt-docs:`cookbook/features.html#gmt-modern-mode-hierarchical-levels`).
grd2cpt.py:        at :gmt-docs:`cookbook/cpts.html#built-in-color-palette-tables-cpt`.
grd2cpt.py:        See also :gmt-docs:`cookbook/features.html#manipulating-cpts`.
grd2cpt.py:        :gmt-docs:`cookbook/features.html#manipulating-cpts`.
makecpt.py:    :gmt-docs:`cookbook/features.html#gmt-modern-mode-hierarchical-levels`).
makecpt.py:        at :gmt-docs:`cookbook/cpts.html#built-in-color-palette-tables-cpt`.
makecpt.py:        See also :gmt-docs:`cookbook/features.html#manipulating-cpts`.
makecpt.py:        :gmt-docs:`cookbook/features.html#manipulating-cpts`.
select.py:        <cookbook/file-formats.html#optional-segment-header-records>`
select.py:        <cookbook/file-formats.html#optional-segment-header-records>`
shift_origin.py:    :gmt-docs:`cookbook/options.html#plot-positioning-and-layout-the-x-y-options`
text.py:    See :gmt-docs:`cookbook/octal-codes.html` for the full list of supported
velo.py:        :gmt-docs:`cookbook/features.html#gfill-attrib`.
velo.py:        :gmt-docs:`cookbook/features.html#gfill-attrib`.

Admin@XXXXXX */pygmt/examples/gallery
$ grep "cookbook" */*
embellishments/colorbar.py:can be found at :gmt-docs:`cookbook/cpts.html`. You can set the ``position`` of
embellishments/colorbars_multiple.py::gmt-docs:`cookbook/features.html#gmt-modern-mode-hierarchical-levels` for
lines/linestyles.py:For more advanced *pen* attributes, see the GMT cookbook
lines/linestyles.py::gmt-docs:`cookbook/features.html#wpen-attrib`.
symbols/custom_symbols.py:cookbook :gmt-docs:`cookbook/custom-symbols.html`.
symbols/patterns.py:https://docs.generic-mapping-tools.org/latest/cookbook/predefined-patterns.html.
symbols/text_symbols.py:For all supported octal codes and fonts see the GMT cookbook
symbols/text_symbols.py::gmt-docs:`cookbook/octal-codes.html` and
symbols/text_symbols.py::gmt-docs:`cookbook/postscript-fonts.html`.

Admin@XXXXXX */pygmt/examples/get_started
$ grep "cookbook" *
02_contour_map.py:# at :gmt-docs:`cookbook/cpts.html`.

Admin@XXXXXX */pygmt/examples/projections
$ grep "cookbook" */*
nongeo/cartesian_linear.py:<cookbook/coordinate-transformations.html#geographic-coordinates>`.
nongeo/cartesian_linear.py:<cookbook/coordinate-transformations.html#calendar-time-coordinates>`.

Admin@XXXXXX */pygmt/examples/tutorials
$ grep "cookbook" */*
advanced/earth_relief.py:# projections, see :gmt-docs:`cookbook/map-projections.html`.
advanced/earth_relief.py:# A full list of CPTs can be found at :gmt-docs:`cookbook/cpts.html`.
basics/text.py:# :gmt-docs:`PostScript Fonts Used by GMT <cookbook/postscript-fonts.html>`,
basics/text.py:# at :gmt-docs:`text.html` and also the cookbook at
basics/text.py:# :gmt-docs:`cookbook/features.html#placement-of-text`. Good luck!

@seisman
Copy link
Member

seisman commented Sep 11, 2023

Currently, they are all linked to the latest version of the GMT docs (i.e., https://docs.generic-mapping-tools.org/latest/). The problem is, if there are any upstream changes in the documentation structure, the links of all versions of PyGMT documentation (not only the dev version, but also any previous versions) will be broken.

I think we should link to a specific version of GMT docs instead (currently https://docs.generic-mapping-tools.org/6.4/). When GMT 6.5 is released, we need to update it to https://docs.generic-mapping-tools.org/6.5/.

@weiji14
Copy link
Member

weiji14 commented Sep 11, 2023

I think we should link to a specific version of GMT docs instead (currently https://docs.generic-mapping-tools.org/6.4/). When GMT 6.5 is released, we need to update it to https://docs.generic-mapping-tools.org/6.5/.

Yeah, might be good to change latest to 6.4 here:

pygmt/doc/conf.py

Lines 50 to 55 in 67e4ec2

# configure links to GMT docs
extlinks = {
"gmt-docs": ("https://docs.generic-mapping-tools.org/latest/%s", None),
"gmt-term": ("https://docs.generic-mapping-tools.org/latest/gmt.conf#term-%s", ""),
"gmt-datasets": ("https://www.generic-mapping-tools.org/remote-datasets/%s", None),
}

@seisman seisman merged commit da45244 into main Sep 12, 2023
@seisman seisman deleted the update-link-octalcodes branch September 12, 2023 05:58
@yvonnefroehlich yvonnefroehlich self-assigned this Sep 14, 2023
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 skip-changelog Skip adding Pull Request to changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Link Checker Report on 2023-09-10

4 participants