Thanks to visit codestin.com
Credit goes to github.com

Skip to content

rst markup simplification #9166

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

Closed
wants to merge 4 commits into from
Closed

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Sep 7, 2017

PR Summary

See #7502 for the original issue.

We don't actually need to use the any role yet; right now the default is already the obj role, which resolves to any documented Python object. We can always switch the default to any (as suggested by #7502) at some later point, although I would prefer sphinx-doc/sphinx#3616 be fixed before doing that.

Right now, this PR only changes .py files and not .rst files, as in the latter case we probably need to think about what to do with the old whatsnews (if we agree to make the change everywhere it can easily be added).

The PR doesn't re-line wrap the newly formatted docstrings yet as this probably needs to be done manually (and is a lot of work that can be done in subsequent PRs in a piecemeal fashion), but redoing the wrapping would probably further enhance the legibility of the docstrings.

The first commit was simply done by running

sed -i -E 's/:(mod|class|func|data|meth):`/`/g' **/*.py

The second commit fixes a few markups to make the doc build again, as explained in the commit text:

numpydoc does not like entries in See Also sections to be backquoted
without an explicit role, but it is able to handle them without
backquotes at all (in fact, that format is given in the numpydoc
specification). Fix the corresponding docstrings accordingly, and
line-wrap them.

The last commits contains piecemeal minor markup fixes.

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

This was done by running.

    sed -i -E 's/:(mod|class|func|data|meth):`/`/g' **/*.py

The current default_role setting for sphinx is `obj`, which means that
backticks-wrapped terms automatically look up documented Python objects.
numpydoc does not like entries in See Also sections to be backquoted
without an explicit role, but it is able to handle them without
backquotes at all (in fact, that format is given in the numpydoc
specification).  Fix the corresponding docstrings accordingly, and
line-wrap them.
@anntzer anntzer force-pushed the rst-update branch 3 times, most recently from dcceac4 to f2658f9 Compare September 8, 2017 09:16
Axes.pick can be removed as it just inherits Artist.pick.
@anntzer
Copy link
Contributor Author

anntzer commented Sep 10, 2017

[Temporarily closing the PR as I would prefer #9173 be merged first to avoid some tricky rebase; will reopen later.]

@anntzer anntzer closed this Sep 10, 2017
@anntzer anntzer deleted the rst-update branch October 6, 2017 22:33
@anntzer anntzer self-assigned this Oct 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant