Skip to content

Commit ff0d5a4

Browse files
DOC: Fixed template structure CSS (#16067)
This was overriding the CSS on the rest of the page. Reported in #15581 (comment) Also inlines the CSS from our theme. [ci skip]
1 parent 7471d32 commit ff0d5a4

File tree

2 files changed

+38
-10
lines changed

2 files changed

+38
-10
lines changed

doc/source/style.ipynb

+38-7
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"cell_type": "code",
5050
"execution_count": null,
5151
"metadata": {
52+
"collapsed": true,
5253
"nbsphinx": "hidden"
5354
},
5455
"outputs": [],
@@ -61,7 +62,9 @@
6162
{
6263
"cell_type": "code",
6364
"execution_count": null,
64-
"metadata": {},
65+
"metadata": {
66+
"collapsed": true
67+
},
6568
"outputs": [],
6669
"source": [
6770
"import pandas as pd\n",
@@ -127,7 +130,9 @@
127130
{
128131
"cell_type": "code",
129132
"execution_count": null,
130-
"metadata": {},
133+
"metadata": {
134+
"collapsed": true
135+
},
131136
"outputs": [],
132137
"source": [
133138
"def color_negative_red(val):\n",
@@ -181,7 +186,9 @@
181186
{
182187
"cell_type": "code",
183188
"execution_count": null,
184-
"metadata": {},
189+
"metadata": {
190+
"collapsed": true
191+
},
185192
"outputs": [],
186193
"source": [
187194
"def highlight_max(s):\n",
@@ -244,7 +251,9 @@
244251
{
245252
"cell_type": "code",
246253
"execution_count": null,
247-
"metadata": {},
254+
"metadata": {
255+
"collapsed": true
256+
},
248257
"outputs": [],
249258
"source": [
250259
"def highlight_max(data, color='yellow'):\n",
@@ -810,7 +819,9 @@
810819
{
811820
"cell_type": "code",
812821
"execution_count": null,
813-
"metadata": {},
822+
"metadata": {
823+
"collapsed": true
824+
},
814825
"outputs": [],
815826
"source": [
816827
"def magnify():\n",
@@ -872,7 +883,9 @@
872883
{
873884
"cell_type": "code",
874885
"execution_count": null,
875-
"metadata": {},
886+
"metadata": {
887+
"collapsed": true
888+
},
876889
"outputs": [],
877890
"source": [
878891
"df.style.\\\n",
@@ -1058,6 +1071,23 @@
10581071
"source": [
10591072
"See the template in the [GitHub repo](https://github.com/pandas-dev/pandas) for more details."
10601073
]
1074+
},
1075+
{
1076+
"cell_type": "code",
1077+
"execution_count": null,
1078+
"metadata": {
1079+
"nbsphinx": "hidden"
1080+
},
1081+
"outputs": [],
1082+
"source": [
1083+
"# Hack to get the same style in the notebook as the\n",
1084+
"# main site. This is hidden in the docs.\n",
1085+
"from IPython.display import HTML\n",
1086+
"with open(\"themes/nature_with_gtoc/static/nature.css_t\") as f:\n",
1087+
" css = f.read()\n",
1088+
" \n",
1089+
"HTML('<style>{}</style>'.format(css))"
1090+
]
10611091
}
10621092
],
10631093
"metadata": {
@@ -1075,7 +1105,8 @@
10751105
"mimetype": "text/x-python",
10761106
"name": "python",
10771107
"nbconvert_exporter": "python",
1078-
"pygments_lexer": "ipython3"
1108+
"pygments_lexer": "ipython3",
1109+
"version": "3.6.1"
10791110
}
10801111
},
10811112
"nbformat": 4,

doc/source/template_structure.html

-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
-->
1010
<style type="text/css">
1111
/* Overrides of notebook CSS for static HTML export */
12-
body {
13-
font-family: sans;
14-
}
1512
.template_block {
1613
background-color: hsla(120, 60%, 70%, 0.2);
1714
margin: 10px;

0 commit comments

Comments
 (0)