-
Notifications
You must be signed in to change notification settings - Fork 131
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
Nicer display of pandas dataframes in nbsphinx #182
Comments
Can you please provide an example notebook and screenshots for the "nice" and "ugly" cases? Please also provide a screenshot how it looks when using |
Of course. This is "nice": (I am using a dark theme in jupyter, I, don't expect the result to be dark but to look as in the light, vanilla theme.) This is "ugly": Downloading from jupyter notebook as HTML (nbconvert) leads to the "nice" version. This download is made on my laptop while doc generation is done in a container. Are there package dependencies other than listed in nbsphinx documentation that could explain this behaviour? Sample notebook: https://gist.github.com/gansanay/34363886efeb3e7c958a281811c14822 |
Interestingly, when calling I think this is only a matter of which CSS is included. You can add whatever CSS you like to your Sphinx configuration. Or, if you think some CSS should be added directly to |
@gansanay Were you able to get "nice" dataframes in the end? |
I have the same issue. Looking here I found that this behavior is related to nbconvert versioning. By using nbconvert (version 5.3.1) directly with I even tried to provide a custum .css file (as shown here), using https://cdn.jupyter.org/notebook/5.1.0/style/style.min.css; this did not work either. |
You should be able to load the CSS file in your def setup(app):
app.add_stylesheet(
'https://cdn.jupyter.org/notebook/5.1.0/style/style.min.css') In the upcoming Sphinx 1.8.0 release, this can also be done with html_css_files = ['https://cdn.jupyter.org/notebook/5.1.0/style/style.min.css'] The bad news, however, is that this doesn't seem to work well with the Sphinx and If you want to improve the situation, please make a PR that puts a copy of the official Jupyter Notebook CSS (I guess for the |
I tried the solutions proposed by @mgeier, but none worked. I dont know how to do some workaround nor help to build a solution. I tried both versions 5.1.0 and 5.4.0 :
and
and, both of this too:
and
This The results of use nbconvert and nbsphinx are bellow: Another stuff that I noticed were that the colors of many things, import line, strings, and numbers are different too. I guess that it is because the css problem too? The versions of the libraries that I am using: Sphinx==1.8.1 |
I've added some CSS definitions in #228, can you please check if that works for you? If you find some missing CSS definitions, please tell me. |
Sorry for the late answer. I tested now and the issue still happening. How do you test that you have solved the problem? How can I help you find why I still face the issue? I use Docker and for help to find where the problem is I have put every thing in a github repository to try help you figure out why the problem still happening. |
@PedroRegisPOAR Have you used the You should try to install
|
Hi,
I may have missed something but... I can't get pandas dataframes to display in nbsphinx generated docs as nicely as they display in jupyter notebook. I get an ugly large font in an ugly black and white table.
Is it just a CSS issue?
Regards,
Guillaume
The text was updated successfully, but these errors were encountered: