Skip to content

DOC: Combine the modern and classic ReST files into a single file #8486

@seisman

Description

@seisman

For almost all plotting modules, we usually have two separate ReST files for modern and classic modes, respectively. For example, we have image.rst and psimage.rst and gmtlogo.rst and gmtlogo-classic.rst.

More ReST files usually mean more maintenance burden, especially sometimes we may fix or update the modern mode examples in one file, but forget to update the corresponding examples in another file.

So, I guess it makes more sense to have only one documentation file for a single module. Usually, the differences of modern and classic ReST files are:

  • -K/-O/-P is only available in classic mode
  • Examples have different syntax.

For point 1, this can be addressed by emphasizing the these options are classic-mode only. For point 2, modern/classic modes can be switched using sphinx-design's tab directive (https://sphinx-design.readthedocs.io/en/furo-theme/tabs.html).

#8487 is an example PR showing how it works.

The title:

Screenshot from 2024-05-13 12-01-39

Classic-only options:

Screenshot from 2024-05-13 12-02-19

Modern-mode example:

Screenshot from 2024-05-13 12-02-55

Classic-mode examples (after clicking the "Classic mode" Tab:
Screenshot from 2024-05-13 12-03-10

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionTopics for longer discussion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions