Skip to content

Linebreak is bleeding into the documentation page #27708

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

Merged
merged 2 commits into from
Aug 3, 2019

Conversation

clemens-tolboom
Copy link
Contributor

https://pandas.pydata.org/pandas-docs/stable/reference/series.html

<table><td>
...
<tr class="row-even"><td><a class="reference internal" href="api/pandas.Series.T.html#pandas.Series.T" title="pandas.Series.T"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Series.T</span></code></a></td>
<td>Return the transpose, which is by</td>
</tr>
...
</td>
</table>

And looks weird on https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.T.html#pandas.Series.T

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

https://pandas.pydata.org/pandas-docs/stable/reference/series.html

<tr class="row-even"><td><a class="reference internal" href="api/pandas.Series.T.html#pandas.Series.T" title="pandas.Series.T"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Series.T</span></code></a></td>
<td>Return the transpose, which is by</td>
</tr>
And looks weird on https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.T.html#pandas.Series.T
@WillAyd
Copy link
Member

WillAyd commented Aug 2, 2019

I think need to add an explicit continuation and maybe decent to fix while passing code checks

@clemens-tolboom
Copy link
Contributor Author

I think need to add an explicit continuation and maybe decent to fix while passing code checks

@WillAyd I don't get the explicit continuation

The linter failures are not informative (exit 1)

My line is 74 characters long and the file has longer lines.

@WillAyd
Copy link
Member

WillAyd commented Aug 2, 2019

Sorry meant escape the line break.

On phone so didn’t see exact check failure - do you need help with message?

@WillAyd
Copy link
Member

WillAyd commented Aug 2, 2019

Looks like you need to run black against the module

@TomAugspurger
Copy link
Contributor

Anyone know why we need the newlines to begin with?

@TomAugspurger TomAugspurger added this to the 1.0 milestone Aug 2, 2019
@WillAyd
Copy link
Member

WillAyd commented Aug 2, 2019

If I had to guess just matches our standard of

def func():
    """
    Docstring goes here.
    """

Instead of having that all on one line.

@TomAugspurger
Copy link
Contributor

Good guess.

This diff from master seems to pass the docstring checks

diff --git a/pandas/core/base.py b/pandas/core/base.py
index cfa8d2521..38a8bf717 100644
--- a/pandas/core/base.py
+++ b/pandas/core/base.py
@@ -687,8 +687,9 @@ class IndexOpsMixin:
 
     T = property(
         transpose,
-        doc="""\nReturn the transpose, which is by
-                                definition self.\n""",
+        doc="""
+        Return the transpose, which is by definition self.
+        """,
     )
 
     @property

@clemens-tolboom do you want to try that?

@clemens-tolboom
Copy link
Contributor Author

clemens-tolboom commented Aug 3, 2019

@TomAugspurger your suggestion is way better :-)

Done

@WillAyd
Copy link
Member

WillAyd commented Aug 3, 2019

Looks good! Just as one last check can you see how this renders? We might need to wrap the string in dedent with this approach

@TomAugspurger
Copy link
Contributor

It looked fine to me locally.

@TomAugspurger TomAugspurger merged commit 66ada8c into pandas-dev:master Aug 3, 2019
@TomAugspurger
Copy link
Contributor

Thanks!

@clemens-tolboom clemens-tolboom deleted the patch-1 branch August 4, 2019 11:33
quintusdias pushed a commit to quintusdias/pandas_dev that referenced this pull request Aug 16, 2019
* Linebreak is bleeding into the documentation page

https://pandas.pydata.org/pandas-docs/stable/reference/series.html

<tr class="row-even"><td><a class="reference internal" href="api/pandas.Series.T.html#pandas.Series.T" title="pandas.Series.T"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Series.T</span></code></a></td>
<td>Return the transpose, which is by</td>
</tr>
And looks weird on https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.T.html#pandas.Series.T

* Make \n real new line

As suggested by @TomAugspurger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants