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: Convert README from ReST to Markdown #3059

Merged
merged 25 commits into from
Feb 27, 2024
Merged

doc: Convert README from ReST to Markdown #3059

merged 25 commits into from
Feb 27, 2024

Conversation

yvonnefroehlich
Copy link
Member

@yvonnefroehlich yvonnefroehlich commented Feb 20, 2024

Description of proposed changes

This PR converts the REAMDE from ReStructuredText to Markdown.

  • Use pandoc to convert to markdown
  • Make manual adjustments
  • Fix image
  • Update files
  • Fix appearance on webpage
    Adding .. doc-index-start-after and .. doc-index-end-before does not work correctly. We have to look for the corresponding Markdown syntax

Preview:

Fixes #2928

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 command is:

  • /format: automatically format and lint the code

@yvonnefroehlich yvonnefroehlich added the maintenance Boring but important stuff for the core devs label Feb 20, 2024
@yvonnefroehlich yvonnefroehlich added this to the 0.12.0 milestone Feb 20, 2024
@yvonnefroehlich yvonnefroehlich changed the title doc: Convert README from ReStructuredText to Markdown doc: Convert README from ReST to Markdown Feb 20, 2024
@seisman
Copy link
Member

seisman commented Feb 21, 2024

README.rst is hard-coded in many files. Need to update README.rst to README.md in all these files:

pyproject.toml:8:readme = "README.rst"
doc/maintenance.md:225:9. Refresh citation information. Specifically, the BibTeX in `README.rst` and
doc/index.rst:13:.. include:: ../README.rst
.github/workflows/ci_docs.yml:26:      - 'README.rst'
.github/workflows/ci_docs.yml:35:      - 'README.rst'
.github/workflows/publish-to-pypi.yml:27:      - 'README.rst'
.readthedocs.yaml:24:              README.rst \

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
doc/maintenance.md Outdated Show resolved Hide resolved
@yvonnefroehlich
Copy link
Member Author

README.rst is hard-coded in many files. Need to update README.rst to README.md in all these files:

pyproject.toml:8:readme = "README.rst"
doc/maintenance.md:225:9. Refresh citation information. Specifically, the BibTeX in `README.rst` and
doc/index.rst:13:.. include:: ../README.rst
.github/workflows/ci_docs.yml:26:      - 'README.rst'
.github/workflows/ci_docs.yml:35:      - 'README.rst'
.github/workflows/publish-to-pypi.yml:27:      - 'README.rst'
.readthedocs.yaml:24:              README.rst \

Thanks for posting this list! These files should be updated in the commits 3360f45, 7be24c3, and a68367c.

@yvonnefroehlich
Copy link
Member Author

Currently building the documentation fails and the issue seem to be related to downloading the GMT remote datasets:

    pygmt.exceptions.GMTCLibError: Module 'grdcut' failed with status code 72:
    grdcut [ERROR]: Remote download is currently deactivated
    grdcut [ERROR]: Unable to obtain remote file @earth_relief_10m_g

Is there currently any maintenance regarding the remote datasets and they are temporarily not available?
This issue is also reported in #3063.

@seisman
Copy link
Member

seisman commented Feb 24, 2024

Do other mirrors work?

@MarcoSal
Copy link

Currently building the documentation fails and the issue seem to be related to downloading the GMT remote datasets:

    pygmt.exceptions.GMTCLibError: Module 'grdcut' failed with status code 72:
    grdcut [ERROR]: Remote download is currently deactivated
    grdcut [ERROR]: Unable to obtain remote file @earth_relief_10m_g

Is there currently any maintenance regarding the remote datasets and they are temporarily not available? This issue is also reported in #3063.

now it's working again. the service was probably under maintenance.

@yvonnefroehlich
Copy link
Member Author

It looks like downloading the remote datasets works again and this was only a temporary issue.

@seisman
Copy link
Member

seisman commented Feb 25, 2024

  • Fix appearance on webpage
    Adding .. doc-index-start-after and .. doc-index-end-before does not work correctly. We have to look for the corresponding Markdown syntax

Does the solution here
https://stackoverflow.com/questions/46278683/include-my-markdown-readme-into-sphinx/68005314#68005314 work for you?

doc/index.rst Outdated
Comment on lines 13 to 15
.. include:: ../README.md
:start-after: doc-index-start-after
:end-before: doc-index-end-before
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. include:: ../README.md
:start-after: doc-index-start-after
:end-before: doc-index-end-before
```{include} ../README.md
:start-after: doc-index-start-after
:end-before: doc-index-end-before
```

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this idea, but unfortunately, this also does not work:

GitHub Website
include_md_in_rst_GitHub include_md_in_rst_Webside

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps you have to convert index.rst to index.md

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try this, but I will be quite busy in the next three weeks. Thus, I am not sure if I will have the time to do this in the next days 🙁.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've done this in commit 514420a.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @seisman for doing this and completing this PR.

Comment on lines 232 to 237
### Check the README Syntax

GitHub is a bit forgiving when it comes to the RST syntax in the README but PyPI is not.
GitHub is a bit forgiving when it comes to the syntax in the README but PyPI is not.
To check the README syntax, visit the
[PyGMT TestPyPI release history](https://test.pypi.org/project/pygmt/#history), select
the latest commit, and review the left sidebar and project description for any errors.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://packaging.python.org/en/latest/guides/making-a-pypi-friendly-readme/#creating-a-readme-file

PyPI uses the GitHub Flavored Markdown syntax by default, so we no longer need to check the README syntax on PyPI.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 1342678.

@seisman seisman added the final review call This PR requires final review and approval from a second reviewer label Feb 26, 2024
@seisman seisman merged commit d2e0c08 into main Feb 27, 2024
9 of 10 checks passed
@seisman seisman deleted the convert-readme-rst2md branch February 27, 2024 00:37
@seisman seisman added skip-changelog Skip adding Pull Request to changelog and removed final review call This PR requires final review and approval from a second reviewer labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert documentation source files from ReStructuredText to Markdown
4 participants