From 3cb7a3722496783daf6dcff6b93d9ff0b4a686b1 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Thu, 20 Apr 2017 06:34:22 -0500 Subject: [PATCH] DOC: Fixed template structure CSS This was overriding the CSS on the rest of the page. Reported in https://github.com/pandas-dev/pandas/pull/15581#issuecomment-295696168 Also inlines the CSS from our theme. [ci skip] --- doc/source/style.ipynb | 45 +++++++++++++++++++++++++----- doc/source/template_structure.html | 3 -- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/doc/source/style.ipynb b/doc/source/style.ipynb index 40b692441e7dc..a9d9c8de40b70 100644 --- a/doc/source/style.ipynb +++ b/doc/source/style.ipynb @@ -49,6 +49,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "collapsed": true, "nbsphinx": "hidden" }, "outputs": [], @@ -61,7 +62,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "import pandas as pd\n", @@ -127,7 +130,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "def color_negative_red(val):\n", @@ -181,7 +186,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "def highlight_max(s):\n", @@ -244,7 +251,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "def highlight_max(data, color='yellow'):\n", @@ -810,7 +819,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "def magnify():\n", @@ -872,7 +883,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "df.style.\\\n", @@ -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(''.format(css))" + ] } ], "metadata": { @@ -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, diff --git a/doc/source/template_structure.html b/doc/source/template_structure.html index 81dbe2b7d0217..0778d8e2e6f18 100644 --- a/doc/source/template_structure.html +++ b/doc/source/template_structure.html @@ -9,9 +9,6 @@ -->