-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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: fix slashes in read_csv line_terminator/sep kwargs descriptions #13761
Conversation
@shawnheide Could you try if using raw strings works as well? Because that way it would maybe be possible to have it look good in both the plain text docstring as the online html one. |
@jorisvandenbossche I hadn't thought about the docstrings before, still learning I guess. It looks like the build failed under 2.7 for some reason as well. I tried with raw docstrings and the Sphinx still converted them. My last attempt was to use the raw docstrings and enclose the special characters ("/s+", etc.) in double back ticks, which keeps Sphinx from interpreting them. This works for the docs, but then the docstrings show the back ticks (see attached images). I searched the codebase for other examples of special characters in both the docstrings and documentation but couldn't find any. Anyone have any other ideas? |
And when using raw string, but without the backticks, sphinx does still interprete the backslash? The travis failure is because we have a linter for one of the 2.7 builds. If you look at the log of the failing build, down below, there is the output of the linter: pandas/io/parsers.py:282:80: E501 line too long (80 > 79 characters) |
Yes, with raw string it still interprets backslash characters, so the docs look the same as they currently do now. I found the warning box on this page helpful in understanding what's going on with Sphinx. Thanks for explaining the build failure. I looked at the details, but must have missed seeing that explanation. I'll make sure my next commit keeps the code at less than 80 characters long. Just to clarify, you're saying to use the version I posted images for with the raw docstrings and the backticks correct? |
Yes, those look good!
My interpretation is that the raw string ensures that sphinx sees the backslash, but that sphinx also uses the backslash itself to escape characters it uses (eg |
Current coverage is 85.31% (diff: 100%)@@ master #13761 diff @@
==========================================
Files 141 141
Lines 50679 50679
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
- Hits 43240 43239 -1
- Misses 7439 7440 +1
Partials 0 0
|
…, and to_csv in ordert to produce correct docs and docstrings
@shawnheide Thanks a lot! |
git diff upstream/master | flake8 --diff
Added additional '' characters in order to produce the correct format in the documentation.