|
2 | 2 | "cells": [
|
3 | 3 | {
|
4 | 4 | "cell_type": "code",
|
5 |
| - "execution_count": 3, |
| 5 | + "execution_count": 1, |
6 | 6 | "metadata": {},
|
7 | 7 | "outputs": [],
|
8 | 8 | "source": [
|
|
14 | 14 | },
|
15 | 15 | {
|
16 | 16 | "cell_type": "code",
|
17 |
| - "execution_count": 12, |
| 17 | + "execution_count": 34, |
18 | 18 | "metadata": {},
|
19 | 19 | "outputs": [],
|
20 | 20 | "source": [
|
|
57 | 57 | " # if os.path.exists(p / ):\n",
|
58 | 58 | " # child['src'] = tempname(child['src'])\n",
|
59 | 59 | "\n",
|
60 |
| - " if child.name == 'body':\n", |
61 |
| - " # id=\"legacy-docs-banner\" class=\"warning\"\n", |
| 60 | + " if child.name == 'body': \n", |
| 61 | + " # expect to share stylesheet with class=\"warning\"\n", |
62 | 62 | " banner = BS('''<div id=\"unreleased-message\"> \n",
|
63 | 63 | " You are reading documentation that no longer exists in the\n",
|
64 | 64 | " current release of Matplotlib! <a href=\"{}\">Try searching for\n",
|
65 | 65 | " an updated version?</a>\n",
|
66 | 66 | " </div>'''.format(search), 'html.parser')\n",
|
67 |
| - " child.insert(0, banner)\n", |
| 67 | + " \n", |
| 68 | + " inject = True\n", |
| 69 | + " for div in child.children:\n", |
| 70 | + " if div.name == 'div' and div.attrs.get('id', 'none') \\\n", |
| 71 | + " == 'unreleased-message': \n", |
| 72 | + " div.replaceWith(banner)\n", |
| 73 | + " inject = False; break\n", |
| 74 | + " if inject:\n", |
| 75 | + " child.insert(0, banner)\n", |
68 | 76 | "\n",
|
69 | 77 | " if not dry:\n",
|
70 | 78 | " with open(p/file, \"wt\") as g:\n",
|
71 | 79 | " g.write(str(parse))\n",
|
72 | 80 | " else:\n",
|
73 |
| - " print( query )" |
| 81 | + " print( '' if inject else '(rerun)', query )" |
74 | 82 | ]
|
75 | 83 | },
|
76 | 84 | {
|
77 | 85 | "cell_type": "code",
|
78 |
| - "execution_count": 13, |
| 86 | + "execution_count": 36, |
79 | 87 | "metadata": {},
|
80 |
| - "outputs": [ |
81 |
| - { |
82 |
| - "name": "stdout", |
83 |
| - "output_type": "stream", |
84 |
| - "text": [ |
85 |
| - "contourf log\n", |
86 |
| - "The Matplotlib Developers’ Guide\n", |
87 |
| - "matplotlib animation Animation save\n" |
88 |
| - ] |
89 |
| - } |
90 |
| - ], |
| 88 | + "outputs": [], |
91 | 89 | "source": [
|
92 |
| - "adjust('examples/images_contours_and_fields', 'contourf_log.html', dry=True)\n", |
93 |
| - "adjust('devel', 'index.html', True)\n", |
94 |
| - "adjust('api/_as_gen', 'matplotlib.animation.Animation.save.html', True)" |
| 90 | + "adjust('examples/images_contours_and_fields', 'contourf_log.html', dry=False)\n", |
| 91 | + "# adjust('devel', 'index.html', True)\n", |
| 92 | + "# adjust('api/_as_gen', 'matplotlib.animation.Animation.save.html', True)" |
95 | 93 | ]
|
96 | 94 | },
|
97 | 95 | {
|
|
0 commit comments