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
Make nbconvert html full output like notebook's html. #5232
Conversation
@@ -40,8 +40,10 @@ In [{{ cell.prompt_number }}]: | |||
{% endblock output_prompt %} | |||
|
|||
{% block input %} | |||
<div class="input_area box-flex1"> | |||
<div class="inner_cell"> | |||
<div class="input_area"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No box-flex1
on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wasn't in the normal notebook's html.
@ellisonbg this is ready for review. |
@@ -59,8 +61,7 @@ In [{{ cell.prompt_number }}]: | |||
{% endblock output %} | |||
|
|||
{% block markdowncell scoped %} | |||
<div class="cell border-box-sizing text_cell"> | |||
<div class="input"> | |||
<div class="cell border-box-sizing text_cell rendered unselected"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think adding unselected is probaby too much
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I agree - just like we don't include the mode classes. The selected
state is nor relevant in static output.
On Wed, Mar 5, 2014 at 11:24 AM, Min RK notifications@github.com wrote:
In IPython/nbconvert/templates/html/basic.tpl:
@@ -59,8 +61,7 @@ In [{{ cell.prompt_number }}]:
{% endblock output %}{% block markdowncell scoped %}
-
-
+I think adding unselected is probaby too much
Reply to this email directly or view it on GitHubhttps://github.com//pull/5232/files#r10314022
.
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com
Two questions:
|
<div style="display: block;" id="site" class="border-box-sizing"> | ||
<div id="ipython-main-app" class="border-box-sizing"> | ||
<div id="notebook_panel" class="border-box-sizing" style="-webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none;"> | ||
<div tabindex="-1" id="notebook" class="border-box-sizing" style="overflow: visible; border-top: none;"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, there shouldn't be any style attributes set anywhere in the template. If you leave these out, is the notebook invisible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I can do is move them into the <style>
tag above where the rest of the CSS is, that's where they belong.
As far is what each one does:
"overflow: visible;" removes the extra vertical scrollbar. Without this the browser's vertical scroll bar renders with very little scrollable space and another vertical scroll bar renders inside the document, around the notebook contents, which handles the scrolling of the document.
"border-top: none;" removes a small 1px grey border from the top of the notebook
shadow stuff- removes a very faint shadow that surrounds the whole document
Basically makes the DOM map one to one. I used a custom in-house HTML diffing rig - https://gist.github.com/jdfreder/9241376
also add output_javascript
still need to do notebook...
Fix for double div on pyout.
use new extra_arg to add output_pyout class
So this is ready for some more review: Upon auditing our |
@@ -498,11 +498,11 @@ var IPython = (function (IPython) { | |||
} else { | |||
// don't display if we don't know how to sanitize it | |||
console.log("Ignoring untrusted " + type + " output."); | |||
continue; | |||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this indentation is now incorrect, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I wonder how that got in there, maybe my Sublime is using tab characters or something, I'll take a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah it was a rebase problem.
That's a good idea, I'll take a look but I think you may be right. |
@minrk that looks much better, thanks for the suggestion. |
@@ -56,7 +56,7 @@ def __call__(self, source, language=None, metadata=None): | |||
if not language: | |||
language=self.default_language | |||
|
|||
return _pygments_highlight(source, HtmlFormatter(), language, metadata) | |||
return _pygments_highlight(source if len(source) > 0 else ' ', HtmlFormatter(), language, metadata) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the reason for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty code cells where collapsing vertically (to something like 5 px). This
gives them the right height when empty.
On Thu, Mar 6, 2014 at 3:50 PM, Min RK notifications@github.com wrote:
In IPython/nbconvert/filters/highlight.py:
@@ -56,7 +56,7 @@ def call(self, source, language=None, metadata=None):
if not language:
language=self.default_language
return _pygments_highlight(source, HtmlFormatter(), language, metadata)
return _pygments_highlight(source if len(source) > 0 else ' ', HtmlFormatter(), language, metadata)
what is the reason for this change?
Reply to this email directly or view it on GitHubhttps://github.com//pull/5232/files#r10367691
.
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
collapsing because codemirror doesn't exist
When this is merge, we need to submit a PR to nbviewer to remove the lines that style the input area, highlight, pre stuff here: https://github.com/ipython/nbviewer/blob/master/nbviewer/templates/notebook.html#L60 This styling is now done in the notebook CSS itself. |
Lots of CSS tweaks to get nbconvert output looking right.
Make nbconvert html full output like notebook's html.
Make nbconvert html full output like notebook's html.
Basically makes the DOMs of both map one to one. This doesn't mean string notebook html == string nbconvert output.
I used a custom in-house HTML diffing rig to diff, see here https://gist.github.com/jdfreder/9241376 (mentioned in the README.md inside nbconvert/tests).
related to #5084
closes #5224