Skip to content

Commit 37633a4

Browse files
committed
RTD docs fixes
1 parent ba86304 commit 37633a4

6 files changed

Lines changed: 107 additions & 25 deletions

File tree

README.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. image:: https://github.com/lukelbd/proplot/blob/master/docs/_static/logo_long.png?raw=true
22
:width: 1000px
33

4-
|build-status| |coverage| |docs| |license| |gitter| |pr-welcome|
4+
|build-status| |docs| |license| |gitter| |pr-welcome|
55

66
A comprehensive, easy-to-use `matplotlib <https://matplotlib.org/>`__ wrapper for making beautiful, publication-quality graphics.
77

@@ -25,10 +25,6 @@ The documentation is `published on readthedocs <https://proplot.readthedocs.io>`
2525
:alt: build status
2626
:target: https://travis-ci.org/lukelbd/proplot
2727

28-
.. |coverage| image:: https://codecov.io/gh/lukelbd/proplot.org/branch/master/graph/badge.svg
29-
:alt: coverage
30-
:target: https://codecov.io/gh/lukelbd/proplot.org
31-
3228
.. |license| image:: https://img.shields.io/github/license/lukelbd/proplot.svg
3329
:alt: license
3430
:target: LICENSE.txt
@@ -45,6 +41,11 @@ The documentation is `published on readthedocs <https://proplot.readthedocs.io>`
4541
:alt: PR welcome
4642
:target: https://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project
4743

44+
..
45+
|coverage| image:: https://codecov.io/gh/lukelbd/proplot.org/branch/master/graph/badge.svg
46+
:alt: coverage
47+
:target: https://codecov.io/gh/lukelbd/proplot.org
48+
4849
..
4950
|quality| image:: https://api.codacy.com/project/badge/Grade/931d7467c69c40fbb1e97a11d092f9cd
5051
:alt: quality

docs/_static/custom.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ a:visited,
245245
color: var(--main-color);
246246
}
247247
.rst-versions .rst-current-version {
248-
color: var(--code-color);
248+
color: var(--call-color);
249249
background-color: var(--l3-bg-color);
250250
}
251251
.rst-versions .rst-other-versions {

docs/_static/pygments/inkpot.css

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
.highlight .hll { background-color: #ffffcc }
2+
.highlight { background: #1e1e27; color: #cfbfad }
3+
.highlight .c { color: #cd8b00 } /* Comment */
4+
.highlight .err { color: #ffffff; background-color: #6e2e2e } /* Error */
5+
.highlight .k { color: #808bed } /* Keyword */
6+
.highlight .n { color: #cfbfad } /* Name */
7+
.highlight .o { color: #666666 } /* Operator */
8+
.highlight .x { color: #cfbfad } /* Other */
9+
.highlight .p { color: #cfbfad } /* Punctuation */
10+
.highlight .ch { color: #cd8b00 } /* Comment.Hashbang */
11+
.highlight .cm { color: #cd8b00 } /* Comment.Multiline */
12+
.highlight .cp { color: #409090 } /* Comment.Preproc */
13+
.highlight .cpf { color: #ffcd8b; background-color: #404040 } /* Comment.PreprocFile */
14+
.highlight .c1 { color: #cd8b00 } /* Comment.Single */
15+
.highlight .cs { color: #808bed } /* Comment.Special */
16+
.highlight .gd { color: #A00000 } /* Generic.Deleted */
17+
.highlight .ge { font-style: italic } /* Generic.Emph */
18+
.highlight .gr { color: #FF0000 } /* Generic.Error */
19+
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
20+
.highlight .gi { color: #00A000 } /* Generic.Inserted */
21+
.highlight .go { color: #888888 } /* Generic.Output */
22+
.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
23+
.highlight .gs { font-weight: bold } /* Generic.Strong */
24+
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
25+
.highlight .gt { color: #0044DD } /* Generic.Traceback */
26+
.highlight .kc { color: #808bed } /* Keyword.Constant */
27+
.highlight .kd { color: #808bed } /* Keyword.Declaration */
28+
.highlight .kn { color: #808bed } /* Keyword.Namespace */
29+
.highlight .kp { color: #808bed } /* Keyword.Pseudo */
30+
.highlight .kr { color: #808bed } /* Keyword.Reserved */
31+
.highlight .kt { color: #ff8bff } /* Keyword.Type */
32+
.highlight .m { color: #f0ad6d } /* Literal.Number */
33+
.highlight .s { color: #ffcd8b; background-color: #404040 } /* Literal.String */
34+
.highlight .na { color: #cfbfad } /* Name.Attribute */
35+
.highlight .nb { color: #808bed } /* Name.Builtin */
36+
.highlight .nc { color: #ff8bff } /* Name.Class */
37+
.highlight .no { color: #409090 } /* Name.Constant */
38+
.highlight .nd { color: #409090 } /* Name.Decorator */
39+
.highlight .ni { color: #cfbfad } /* Name.Entity */
40+
.highlight .ne { color: #ff0000 } /* Name.Exception */
41+
.highlight .nf { color: #c080d0 } /* Name.Function */
42+
.highlight .nl { color: #808bed } /* Name.Label */
43+
.highlight .nn { color: #ff0000 } /* Name.Namespace */
44+
.highlight .nx { color: #cfbfad } /* Name.Other */
45+
.highlight .py { color: #cfbfad } /* Name.Property */
46+
.highlight .nt { color: #cfbfad } /* Name.Tag */
47+
.highlight .nv { color: #cfbfad } /* Name.Variable */
48+
.highlight .ow { color: #666666 } /* Operator.Word */
49+
.highlight .w { color: #434357 } /* Text.Whitespace */
50+
.highlight .mb { color: #f0ad6d } /* Literal.Number.Bin */
51+
.highlight .mf { color: #f0ad6d } /* Literal.Number.Float */
52+
.highlight .mh { color: #f0ad6d } /* Literal.Number.Hex */
53+
.highlight .mi { color: #f0ad6d } /* Literal.Number.Integer */
54+
.highlight .mo { color: #f0ad6d } /* Literal.Number.Oct */
55+
.highlight .sa { color: #ffcd8b; background-color: #404040 } /* Literal.String.Affix */
56+
.highlight .sb { color: #ffcd8b; background-color: #404040 } /* Literal.String.Backtick */
57+
.highlight .sc { color: #ffcd8b; background-color: #404040 } /* Literal.String.Char */
58+
.highlight .dl { color: #ffcd8b; background-color: #404040 } /* Literal.String.Delimiter */
59+
.highlight .sd { color: #808bed; background-color: #404040 } /* Literal.String.Doc */
60+
.highlight .s2 { color: #ffcd8b; background-color: #404040 } /* Literal.String.Double */
61+
.highlight .se { color: #ffcd8b; background-color: #404040 } /* Literal.String.Escape */
62+
.highlight .sh { color: #ffcd8b; background-color: #404040 } /* Literal.String.Heredoc */
63+
.highlight .si { color: #ffcd8b; background-color: #404040 } /* Literal.String.Interpol */
64+
.highlight .sx { color: #ffcd8b; background-color: #404040 } /* Literal.String.Other */
65+
.highlight .sr { color: #ffcd8b; background-color: #404040 } /* Literal.String.Regex */
66+
.highlight .s1 { color: #ffcd8b; background-color: #404040 } /* Literal.String.Single */
67+
.highlight .ss { color: #ffcd8b; background-color: #404040 } /* Literal.String.Symbol */
68+
.highlight .bp { color: #ffff00 } /* Name.Builtin.Pseudo */
69+
.highlight .fm { color: #c080d0 } /* Name.Function.Magic */
70+
.highlight .vc { color: #cfbfad } /* Name.Variable.Class */
71+
.highlight .vg { color: #cfbfad } /* Name.Variable.Global */
72+
.highlight .vi { color: #cfbfad } /* Name.Variable.Instance */
73+
.highlight .vm { color: #cfbfad } /* Name.Variable.Magic */
74+
.highlight .il { color: #f0ad6d } /* Literal.Number.Integer.Long */

docs/conf.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,17 @@
8181
'pr': ('https://github.com/lukelbd/proplot/pull/%s', 'GH#'),
8282
}
8383

84-
# Give *lots* of time for cell execution! The projection tables
85-
# in particular are massive.
84+
# Give *lots* of time for cell execution!
85+
# Note nbsphinx compiles *all* notebooks in docs unless excluded
8686
nbsphinx_timeout = 120
8787

88+
# Set InlineBackend params, maybe nbsphinx skips ones in rctools.py
89+
# Not necessary because rctools.py configures the backend
90+
# nbsphinx_execute_arguments = [
91+
# "--InlineBackend.figure_formats={'svg'}",
92+
# "--InlineBackend.rc={'figure.dpi': 100}",
93+
# ]
94+
8895
# Do not run doctest tests, these are just to show syntax and expected
8996
# output may be graphical
9097
doctest_test_doctest_blocks = ''
@@ -164,13 +171,10 @@
164171

165172
# List of patterns, relative to source directory, that match files and
166173
# directories to ignore when looking for source files.
167-
# This pattern also affects html_static_path and html_extra_path .
168-
# WARNING: Must add 'include' files or will get duplicate label warnings.
169-
# WARNING: Must add files containing showcase examples
170174
exclude_patterns = [
171-
'_templates', '_themes', 'showcase',
172-
'sphinxext', 'automodapi',
173-
'trash', '.DS_Store', '**.ipynb_checkpoints'
175+
'_templates', '_themes', 'sphinxext',
176+
'.DS_Store', '**.ipynb_checkpoints',
177+
# '[0-9a-eg-su-z]*.ipynb', # only run [figures|tight].ipynb for debugging
174178
]
175179

176180
# The name of the Pygments (syntax highlighting) style to use.

docs/environment.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Hard requirements for notebook examples and documentation build
22
# Proplot itself just needs matplotlib
3-
# Try to pip install stuff as it is lighter workload
3+
# NOTE: PyQt5 is needed by pyplot, RTD server *happens* to already have it
4+
# but creating local environment will fail.
45
name: proplot-dev
56
channels:
67
- conda-forge
@@ -12,14 +13,14 @@ dependencies:
1213
- matplotlib
1314
- cartopy
1415
- basemap
15-
- nbsphinx
16-
- sphinx
17-
- ipython
16+
- pandoc
1817
- ipykernel
1918
- pip
2019
- pip:
2120
- ..
2221
- lxml
2322
- pyyaml
23+
- pyqt5
24+
- nbsphinx
2425
- sphinx_rtd_theme
2526
- git+https://github.com/lukelbd/sphinx-automodapi@v0.6.proplot-mods

proplot/rctools.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -776,17 +776,19 @@ def backend_setup(backend=None, fmt=None):
776776

777777
# For notebooks
778778
rc._init = False
779+
ibackend = ('inline' if backend == 'auto' else backend)
779780
try:
780-
ibackend = ('inline' if backend == 'auto' else backend)
781781
ipython.magic('matplotlib ' + ibackend)
782782
rc.reset()
783-
# For terminals
784-
# KeyError is evidently a subclass of the UnknownBackup exception
785-
except KeyError as err:
783+
# For terminals (UnknownBackend is subclass of KeyError)
784+
except KeyError:
786785
if backend != 'auto':
787-
raise err
788-
ipython.magic('matplotlib qt') # use any available Qt backend
789-
rc.reset()
786+
warnings.warn(f'Failed to import {backend!r} backend.')
787+
try:
788+
ipython.magic('matplotlib qt') # use any available Qt backend
789+
rc.reset()
790+
except KeyError: # should be impossible; pyplot needs Qt!
791+
warnings.warn('Failed to import \'qt\' backend.')
790792

791793
# Configure inline backend no matter what type of session this is
792794
# Should be silently ignored for terminal ipython sessions

0 commit comments

Comments
 (0)