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

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

Open
seisman opened this issue May 13, 2024 · 3 comments
Open

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

seisman opened this issue May 13, 2024 · 3 comments
Labels
discussion Topics for longer discussion

Comments

@seisman
Copy link
Member

seisman commented May 13, 2024

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

@Esteban82
Copy link
Member

I like it. I think we should implemen it.

@joa-quim
Copy link
Member

While I like the examples in two tabs, I'm afraid I don't like clear the mix of classic and modern in the man pages. I think it is confusing for users. And also, while I'm not really a modern mode user, remember that it was introduced so that new users are advised to use this only. Bring back the classic to front page is a step back on this.

@seisman
Copy link
Member Author

seisman commented May 13, 2024

That's a good point. The problem is, there are still many users who use classic mode and there are also many existing classic-mode scripts. So modern-mode users still need to know at least the existence of the classic mode. I think we just need to have a section explaining the differences between classic and modern modes and then link to that section when necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Topics for longer discussion
Projects
None yet
Development

No branches or pull requests

3 participants