Skip to content

Commit

Permalink
DOC: Fixed template structure CSS (pandas-dev#16067)
Browse files Browse the repository at this point in the history
This was overriding the CSS on the rest of the page.
Reported in
pandas-dev#15581 (comment)
Also inlines the CSS from our theme.

[ci skip]
  • Loading branch information
TomAugspurger authored and pcluo committed May 22, 2017
1 parent c4aaf98 commit b61f08e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 10 deletions.
45 changes: 38 additions & 7 deletions doc/source/style.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"nbsphinx": "hidden"
},
"outputs": [],
Expand All @@ -61,7 +62,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import pandas as pd\n",
Expand Down Expand Up @@ -127,7 +130,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"def color_negative_red(val):\n",
Expand Down Expand Up @@ -181,7 +186,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"def highlight_max(s):\n",
Expand Down Expand Up @@ -244,7 +251,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"def highlight_max(data, color='yellow'):\n",
Expand Down Expand Up @@ -810,7 +819,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"def magnify():\n",
Expand Down Expand Up @@ -872,7 +883,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"df.style.\\\n",
Expand Down Expand Up @@ -1058,6 +1071,23 @@
"source": [
"See the template in the [GitHub repo](https://github.com/pandas-dev/pandas) for more details."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [],
"source": [
"# Hack to get the same style in the notebook as the\n",
"# main site. This is hidden in the docs.\n",
"from IPython.display import HTML\n",
"with open(\"themes/nature_with_gtoc/static/nature.css_t\") as f:\n",
" css = f.read()\n",
" \n",
"HTML('<style>{}</style>'.format(css))"
]
}
],
"metadata": {
Expand All @@ -1075,7 +1105,8 @@
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3"
"pygments_lexer": "ipython3",
"version": "3.6.1"
}
},
"nbformat": 4,
Expand Down
3 changes: 0 additions & 3 deletions doc/source/template_structure.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
-->
<style type="text/css">
/* Overrides of notebook CSS for static HTML export */
body {
font-family: sans;
}
.template_block {
background-color: hsla(120, 60%, 70%, 0.2);
margin: 10px;
Expand Down

0 comments on commit b61f08e

Please sign in to comment.