Skip to content

DOC: Add note about unicode layout #11231

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 1 commit into from
Oct 7, 2015
Merged

Conversation

sinhrks
Copy link
Member

@sinhrks sinhrks commented Oct 3, 2015

Follow-up for #11102. Added note because doc output may look incorrect depending on font.

@sinhrks sinhrks added Docs Output-Formatting __repr__ of pandas objects, to_string labels Oct 3, 2015
@sinhrks sinhrks added this to the 0.17.0 milestone Oct 3, 2015
@jreback
Copy link
Contributor

jreback commented Oct 3, 2015

hmm maybe better to put this in a code block which has a mono spaced font?

@sinhrks
Copy link
Member Author

sinhrks commented Oct 3, 2015

OK, let me check code block results.

@jreback
Copy link
Contributor

jreback commented Oct 5, 2015

@sinhrks ?

1 similar comment
@jreback
Copy link
Contributor

jreback commented Oct 6, 2015

@sinhrks ?

@sinhrks
Copy link
Member Author

sinhrks commented Oct 6, 2015

I may misunderstand something, but code block doesn't use monospaced font always? I tried both :: and .. code-block::, but the results look same.

Markdown

::

    >>> df = pd.DataFrame({'a': ['xxx', u'¡¡'], 'b': ['yyy', u'¡¡']})
    >>> df
         a    b
    0  xxx  yyy
    1   ¡¡   ¡¡

.. code-block:: python

   >>> df = pd.DataFrame({'a': ['xxx', u'¡¡'], 'b': ['yyy', u'¡¡']})
   >>> df
        a    b
   0  xxx  yyy
   1   ¡¡   ¡¡

Output

2015-10-06 21 11 45

Do you know any way to force all characters to be monospaced? Alternative idea is attach the screenshot of the console...

CC: @jorisvandenbossche

@jorisvandenbossche
Copy link
Member

Hmm, don't think I can help here. So the 'easy' solution is indeed to use a picture that shows the effect (I think that is better than the note in any case, as the user can then visually see what is meant)

Some possible things: the output during the doc built is always decoded to utf-8 in a hack in the ipython directive (https://github.com/pydata/pandas/blob/master/doc/sphinxext/ipython_sphinxext/ipython_directive.py#L255) -> your example above does not use the ipython directive
It happens with the ambiguous width characters? And you needed to change something (the previous PR) to ensure the console output shows correcty? So maybe a similar issue is the case here with the sphinx directive

@sinhrks sinhrks force-pushed the unicode_doc branch 2 times, most recently from a4085d0 to 11c8fad Compare October 7, 2015 14:15
@sinhrks
Copy link
Member Author

sinhrks commented Oct 7, 2015

@jorisvandenbossche Thanks to confirm. The screen capture using ipython directive is attached on the bottom of #11102. Affected characters seems to depend on environment. At a quick glance, CSS doesn't specify monospaced font for highlight blocks.

As a workaround, updated to attach screen captures of each output as below.

2015-10-07 23 11 07

jreback added a commit that referenced this pull request Oct 7, 2015
DOC: Add note about unicode layout
@jreback jreback merged commit 7427205 into pandas-dev:master Oct 7, 2015
@jreback
Copy link
Contributor

jreback commented Oct 7, 2015

thanks @sinhrks

@sinhrks sinhrks deleted the unicode_doc branch October 8, 2015 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants