diff --git a/1.2.1/_static/mpl.css b/1.2.1/_static/mpl.css index 7aa01b73165..a06115eab90 100644 --- a/1.2.1/_static/mpl.css +++ b/1.2.1/_static/mpl.css @@ -505,3 +505,28 @@ ul.search li div.context { ul.keywordmatches li.goodmatch a { font-weight: bold; } + +/* "Go to released version" message. */ +#unreleased-message { + background: #d62728; + box-sizing: border-box; + color: #fff; + font-weight: bold; + left: 0; + min-height: 3em; + padding: 0.7em; + position: fixed; + top: 0; + width: 100%; + z-index: 10000; +} + +#unreleased-message + div { + margin-top: 3em; +} + +#unreleased-message a { + color: #fff; + text-decoration:underline; + +} diff --git a/1.3.0/_static/mpl.css b/1.3.0/_static/mpl.css index bd174f670d4..6568807df7f 100644 --- a/1.3.0/_static/mpl.css +++ b/1.3.0/_static/mpl.css @@ -566,3 +566,27 @@ table.docutils td { width: 30em; } +/* "Go to released version" message. */ +#unreleased-message { + background: #d62728; + box-sizing: border-box; + color: #fff; + font-weight: bold; + left: 0; + min-height: 3em; + padding: 0.7em; + position: fixed; + top: 0; + width: 100%; + z-index: 10000; +} + +#unreleased-message + div { + margin-top: 3em; +} + +#unreleased-message a { + color: #fff; + text-decoration:underline; + +} diff --git a/1.3.1/_static/mpl.css b/1.3.1/_static/mpl.css index bd174f670d4..ddc6982bc51 100644 --- a/1.3.1/_static/mpl.css +++ b/1.3.1/_static/mpl.css @@ -566,3 +566,27 @@ table.docutils td { width: 30em; } + +/* "Go to released version" message. */ +#unreleased-message { + background: #d62728; + box-sizing: border-box; + color: #fff; + font-weight: bold; + left: 0; + min-height: 3em; + padding: 0.7em; + position: fixed; + top: 0; + width: 100%; + z-index: 10000; +} + +#unreleased-message + div { + margin-top: 3em; +} + +#unreleased-message a { + color: #fff; + text-decoration:underline; +} diff --git a/1.4.0/_static/mpl.css b/1.4.0/_static/mpl.css index 545997d29c8..692ddf3c00f 100644 --- a/1.4.0/_static/mpl.css +++ b/1.4.0/_static/mpl.css @@ -650,3 +650,27 @@ figcaption { } + +/* "Go to released version" message. */ +#unreleased-message { + background: #d62728; + box-sizing: border-box; + color: #fff; + font-weight: bold; + left: 0; + min-height: 3em; + padding: 0.7em; + position: fixed; + top: 0; + width: 100%; + z-index: 10000; +} + +#unreleased-message + div { + margin-top: 3em; +} + +#unreleased-message a { + color: #fff; + text-decoration:underline; +} diff --git a/1.4.1/_static/mpl.css b/1.4.1/_static/mpl.css index 545997d29c8..692ddf3c00f 100644 --- a/1.4.1/_static/mpl.css +++ b/1.4.1/_static/mpl.css @@ -650,3 +650,27 @@ figcaption { } + +/* "Go to released version" message. */ +#unreleased-message { + background: #d62728; + box-sizing: border-box; + color: #fff; + font-weight: bold; + left: 0; + min-height: 3em; + padding: 0.7em; + position: fixed; + top: 0; + width: 100%; + z-index: 10000; +} + +#unreleased-message + div { + margin-top: 3em; +} + +#unreleased-message a { + color: #fff; + text-decoration:underline; +} diff --git a/1.4.2/_static/mpl.css b/1.4.2/_static/mpl.css index 545997d29c8..692ddf3c00f 100644 --- a/1.4.2/_static/mpl.css +++ b/1.4.2/_static/mpl.css @@ -650,3 +650,27 @@ figcaption { } + +/* "Go to released version" message. */ +#unreleased-message { + background: #d62728; + box-sizing: border-box; + color: #fff; + font-weight: bold; + left: 0; + min-height: 3em; + padding: 0.7em; + position: fixed; + top: 0; + width: 100%; + z-index: 10000; +} + +#unreleased-message + div { + margin-top: 3em; +} + +#unreleased-message a { + color: #fff; + text-decoration:underline; +} diff --git a/1.4.3/_static/mpl.css b/1.4.3/_static/mpl.css index 545997d29c8..692ddf3c00f 100644 --- a/1.4.3/_static/mpl.css +++ b/1.4.3/_static/mpl.css @@ -650,3 +650,27 @@ figcaption { } + +/* "Go to released version" message. */ +#unreleased-message { + background: #d62728; + box-sizing: border-box; + color: #fff; + font-weight: bold; + left: 0; + min-height: 3em; + padding: 0.7em; + position: fixed; + top: 0; + width: 100%; + z-index: 10000; +} + +#unreleased-message + div { + margin-top: 3em; +} + +#unreleased-message a { + color: #fff; + text-decoration:underline; +} diff --git a/1.5.0/_static/mpl.css b/1.5.0/_static/mpl.css index 545997d29c8..692ddf3c00f 100644 --- a/1.5.0/_static/mpl.css +++ b/1.5.0/_static/mpl.css @@ -650,3 +650,27 @@ figcaption { } + +/* "Go to released version" message. */ +#unreleased-message { + background: #d62728; + box-sizing: border-box; + color: #fff; + font-weight: bold; + left: 0; + min-height: 3em; + padding: 0.7em; + position: fixed; + top: 0; + width: 100%; + z-index: 10000; +} + +#unreleased-message + div { + margin-top: 3em; +} + +#unreleased-message a { + color: #fff; + text-decoration:underline; +} diff --git a/1.5.1/_static/mpl.css b/1.5.1/_static/mpl.css index 66cd21fe64f..0204e7c6a55 100644 --- a/1.5.1/_static/mpl.css +++ b/1.5.1/_static/mpl.css @@ -682,3 +682,27 @@ figcaption { background: #003c63; outline-color: #003c63; } + +/* "Go to released version" message. */ +#unreleased-message { + background: #d62728; + box-sizing: border-box; + color: #fff; + font-weight: bold; + left: 0; + min-height: 3em; + padding: 0.7em; + position: fixed; + top: 0; + width: 100%; + z-index: 10000; +} + +#unreleased-message + div { + margin-top: 3em; +} + +#unreleased-message a { + color: #fff; + text-decoration:underline; +} diff --git a/1.5.3/_static/mpl.css b/1.5.3/_static/mpl.css index 66cd21fe64f..0204e7c6a55 100644 --- a/1.5.3/_static/mpl.css +++ b/1.5.3/_static/mpl.css @@ -682,3 +682,27 @@ figcaption { background: #003c63; outline-color: #003c63; } + +/* "Go to released version" message. */ +#unreleased-message { + background: #d62728; + box-sizing: border-box; + color: #fff; + font-weight: bold; + left: 0; + min-height: 3em; + padding: 0.7em; + position: fixed; + top: 0; + width: 100%; + z-index: 10000; +} + +#unreleased-message + div { + margin-top: 3em; +} + +#unreleased-message a { + color: #fff; + text-decoration:underline; +} diff --git a/2.0.0/_static/mpl.css b/2.0.0/_static/mpl.css index 161a99edbc1..441edd24907 100644 --- a/2.0.0/_static/mpl.css +++ b/2.0.0/_static/mpl.css @@ -786,3 +786,27 @@ div.responsive_subfig img { } } + +/* "Go to released version" message. */ +#unreleased-message { + background: #d62728; + box-sizing: border-box; + color: #fff; + font-weight: bold; + left: 0; + min-height: 3em; + padding: 0.7em; + position: fixed; + top: 0; + width: 100%; + z-index: 10000; +} + +#unreleased-message + div { + margin-top: 3em; +} + +#unreleased-message a { + color: #fff; + text-decoration:underline; +} diff --git a/2.0.1/_static/mpl.css b/2.0.1/_static/mpl.css index 9adea6173b4..a6e7b614982 100644 --- a/2.0.1/_static/mpl.css +++ b/2.0.1/_static/mpl.css @@ -787,3 +787,27 @@ div.responsive_subfig img { } } + +/* "Go to released version" message. */ +#unreleased-message { + background: #d62728; + box-sizing: border-box; + color: #fff; + font-weight: bold; + left: 0; + min-height: 3em; + padding: 0.7em; + position: fixed; + top: 0; + width: 100%; + z-index: 10000; +} + +#unreleased-message + div { + margin-top: 3em; +} + +#unreleased-message a { + color: #fff; + text-decoration:underline; +} diff --git a/2.0.2/_static/mpl.css b/2.0.2/_static/mpl.css index 9adea6173b4..a6e7b614982 100644 --- a/2.0.2/_static/mpl.css +++ b/2.0.2/_static/mpl.css @@ -787,3 +787,27 @@ div.responsive_subfig img { } } + +/* "Go to released version" message. */ +#unreleased-message { + background: #d62728; + box-sizing: border-box; + color: #fff; + font-weight: bold; + left: 0; + min-height: 3em; + padding: 0.7em; + position: fixed; + top: 0; + width: 100%; + z-index: 10000; +} + +#unreleased-message + div { + margin-top: 3em; +} + +#unreleased-message a { + color: #fff; + text-decoration:underline; +} diff --git a/_websiteutils/fixcss.py b/_websiteutils/fixcss.py new file mode 100644 index 00000000000..2fd32d5d6f7 --- /dev/null +++ b/_websiteutils/fixcss.py @@ -0,0 +1,56 @@ +import pathlib +import tempfile +import shutil + +tocheck = [ + pathlib.Path(f"{major}.{minor}.{micro}") + for major in range(2, -1, -1) + for minor in range(6, -1, -1) + for micro in range(6, -1, -1) +] + + +to_add = b""" +/* "Go to released version" message. */ +#unreleased-message { + background: #d62728; + box-sizing: border-box; + color: #fff; + font-weight: bold; + left: 0; + min-height: 3em; + padding: 0.7em; + position: fixed; + top: 0; + width: 100%; + z-index: 10000; +} + +#unreleased-message + div { + margin-top: 3em; +} + +#unreleased-message a { + color: #fff; + text-decoration:underline; +} +""" + +for d in tocheck: + + fname = pathlib.Path(d, '_static', 'mpl.css') + if fname.is_file(): + print(f'checking {fname}') + with open(fname) as f: + if not "#unreleased-message" in f.read(): + doit = True + else: + doit = False + if doit: + print(f'doing {d}') + with tempfile.NamedTemporaryFile(delete=False) as fout: + with open(fname, 'rb') as f: + fout.write(f.read()) + fout.write(to_add) + print(f.name) + shutil.move(fout.name, f.name)