-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Go through package docstrings and markup code snippets as such #3430
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
Comments
@cpcloud interesting.... |
this seems more like an ongoing thing ... although maybe there aren't that many... really no easy way 2 tell if some part of string is valid python code in a big blob of text |
This is indeed the common Sphinx syntax, and it can also be used in the other documentation (like in the whatsnew). Instead of:
you can just use:
since the python highlighting is the default one (see here). But back to the issue: I think there will indeed be very little of this cases, and even then in a lot of cases an example should be included in the example section of the docstring (and then this I quicky went over the docstrings (only the ones that are included in the api docs), and I found two obvious cases of |
I'd prefer to change everything to use the doctest syntax, because it's neater for reading (though it does creating havoc for linting :-/) The skiprows stuff is phrased poorly. It should really just be "Note that: |
otherwise, better to change to doctest syntax because it's more succinct, i.e., change this:
to
And it should be highlighted appropriately. |
especially in isin, this would be better than the existing, because it's much cleaner and neater. (hopefully sphinx handles this correctly - doctests are a pretty common thing in Python)
|
Plus if we were really fastidious, we could actually test the doctests when they were used - e.g. with sphinx doctest extension - http://sphinx-doc.org/ext/doctest.html |
@jtratner You don't like my Best, On Mon, Sep 30, 2013 at 6:55 PM, Jeff Tratner [email protected]:
|
@jtratner I tested it and indeed with adding |
@cpcloud far easier to edit somebody else's work than to write it yourself. |
Given joris's earlier comments, I'll close this as meh. |
@y-p voila, quickly did a PR |
Noted by @karmel in #3422, sphinx supports syntax highlighting/code
quoting in code (ReST) docstrings using double colon + new line:
sphinx 'autodoc' will pick these up and make code look nice.
The text was updated successfully, but these errors were encountered: