Skip to content
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

[CSS?] Inconsistencies in nbconvert divs and IPython Notebook divs? #5206

Closed
ahmadia opened this issue Feb 23, 2014 · 4 comments
Closed

[CSS?] Inconsistencies in nbconvert divs and IPython Notebook divs? #5206

ahmadia opened this issue Feb 23, 2014 · 4 comments
Milestone

Comments

@ahmadia
Copy link
Contributor

ahmadia commented Feb 23, 2014

I'm working with some custom css used by Lorena Barba's group for her AeroPython notebooks. The recent nbviewer bump just borked our layouts. Looking through the HTML being generated by the live Notebook and nbviewer, I'm seeing inconsistencies in the way the cells are being classified by the engines.

In IPython Notebook master, there's a structure like:

(text cell)
<div class ="cell text_cell ...">
(code cell)
<div class="cell code_cell ...">

Output from nbconvert, on the other hand, looks like:

(text cell)
<div class="input">
(code cell)
<div class="cell border-box-sizing code_cell">
-> <div class="input">

I'll be the first to admit, I'm not great at CSS, but this seems incredibly inconsistent to me. Why use input at the top level of nbconvert? Shouldn't that be cell text_cell or cell text_cell_render to be consistent with the rest of the notebook which in turn contain elements of class input?

What am I misunderstanding here? Here's Lorena's current custom.css, which looks terrible on the recent nbviewer because text cells are not being styled.

Release nbconvert in 1.1 appears to generate something like:

(text cell)
<div class ="text_cell_render ...">
(code cell)
<div class="cell code_cell ...">

Which is at least more consistent. I'm wondering why we aren't at least flagging text cells as the generic cell class. Trying to figure out the CSS on the generated HTML is giving me a headache :(

@minrk
Copy link
Member

minrk commented Feb 23, 2014

I think this is just a bug in nbconvert - the class structure should match the live notebook.

@ahmadia
Copy link
Contributor Author

ahmadia commented Feb 23, 2014

For those following along at home, I guess most of the nbconvert to HTML element class hierarchy happen here:

IPython/nbconvert/templates/html/basic.tpl

I'm going to try a hand at gently refactoring that to look more like the live notebook element class hierarchy and submit a PR, but I'm suspecting one of the core devs will need to write the final PR, since I am not very familiar with this code :/

ahmadia added a commit to ahmadia/ipython that referenced this issue Feb 23, 2014
Addresses ipython#5206

This partially mimics the live IPython notebook layout, but is not a
complete solution.
@minrk minrk added this to the 2.0 milestone Feb 24, 2014
@minrk
Copy link
Member

minrk commented Feb 24, 2014

closed by #5212

@minrk minrk closed this as completed Feb 24, 2014
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Addresses ipython#5206

This partially mimics the live IPython notebook layout, but is not a
complete solution.
minrk pushed a commit to jupyter/nbconvert that referenced this issue Apr 20, 2015
Addresses ipython/ipython#5206

This partially mimics the live IPython notebook layout, but is not a
complete solution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants