From f275f8e1645ac02036749f92f497da7c85588150 2014-12-10 20:35:55 From: Jonathan Frederic Date: 2014-12-10 20:35:55 Subject: [PATCH] Merge pull request #7147 from jdfreder/print Meta-p for print --- diff --git a/IPython/html/static/base/less/page.less b/IPython/html/static/base/less/page.less index e37e4cb..56cc52f 100644 --- a/IPython/html/static/base/less/page.less +++ b/IPython/html/static/base/less/page.less @@ -37,11 +37,19 @@ div#header { height: 0px; border-bottom: 1px solid @navbar-default-border; } + + @media print { + display: none !important; + } } #header-spacer { width: 100%; visibility: hidden; + + @media print { + display: none; + } } #ipython_notebook { diff --git a/IPython/html/static/notebook/less/cell.less b/IPython/html/static/notebook/less/cell.less index ed4ad4a..448c570 100644 --- a/IPython/html/static/notebook/less/cell.less +++ b/IPython/html/static/notebook/less/cell.less @@ -8,10 +8,18 @@ div.cell { &.selected { border-color: @border_color; + /* Don't border the cells when printing */ + @media print { + border-color: transparent; + } } &.edit_mode { border-color: green; + /* Don't border the cells when printing */ + @media print { + border-color: transparent; + } } width: 100%; diff --git a/IPython/html/static/notebook/less/codecell.less b/IPython/html/static/notebook/less/codecell.less index 983e97a..accead8 100644 --- a/IPython/html/static/notebook/less/codecell.less +++ b/IPython/html/static/notebook/less/codecell.less @@ -1,4 +1,8 @@ div.code_cell { + /* avoid page breaking on code cells when printing */ + @media print { + page-break-inside: avoid; + } } /* any special styling for code cells that are currently running goes here */ diff --git a/IPython/html/static/style/ipython.min.css b/IPython/html/static/style/ipython.min.css index edbf5cf..95c3eea 100644 --- a/IPython/html/static/style/ipython.min.css +++ b/IPython/html/static/style/ipython.min.css @@ -363,9 +363,21 @@ div.cell { } div.cell.selected { border-color: #ababab; + /* Don't border the cells when printing */ +} +@media print { + div.cell.selected { + border-color: transparent; + } } div.cell.edit_mode { border-color: green; + /* Don't border the cells when printing */ +} +@media print { + div.cell.edit_mode { + border-color: transparent; + } } div.prompt { /* This needs to be wide enough for 3 digit prompt numbers: In[100]: */ @@ -457,6 +469,14 @@ div.unrecognized_cell .inner_cell a:hover { display: none; } } +div.code_cell { + /* avoid page breaking on code cells when printing */ +} +@media print { + div.code_cell { + page-break-inside: avoid; + } +} /* any special styling for code cells that are currently running goes here */ div.input { page-break-inside: avoid; diff --git a/IPython/html/static/style/style.min.css b/IPython/html/static/style/style.min.css index 4eebfbe..06a2e1f 100644 --- a/IPython/html/static/style/style.min.css +++ b/IPython/html/static/style/style.min.css @@ -7768,10 +7768,20 @@ div#header .header-bar { height: 0px; border-bottom: 1px solid #e7e7e7; } +@media print { + div#header { + display: none !important; + } +} #header-spacer { width: 100%; visibility: hidden; } +@media print { + #header-spacer { + display: none; + } +} #ipython_notebook { padding-left: 0px; padding-top: 3px; @@ -8226,9 +8236,21 @@ div.cell { } div.cell.selected { border-color: #ababab; + /* Don't border the cells when printing */ +} +@media print { + div.cell.selected { + border-color: transparent; + } } div.cell.edit_mode { border-color: green; + /* Don't border the cells when printing */ +} +@media print { + div.cell.edit_mode { + border-color: transparent; + } } div.prompt { /* This needs to be wide enough for 3 digit prompt numbers: In[100]: */ @@ -8320,6 +8342,14 @@ div.unrecognized_cell .inner_cell a:hover { display: none; } } +div.code_cell { + /* avoid page breaking on code cells when printing */ +} +@media print { + div.code_cell { + page-break-inside: avoid; + } +} /* any special styling for code cells that are currently running goes here */ div.input { page-break-inside: avoid;