|
17 | 17 |
|
18 | 18 | # -- Project information ----------------------------------------------------- |
19 | 19 |
|
20 | | -project = "stackstac" |
21 | | -copyright = "2021, Gabe Joseph" |
22 | | -author = "Gabe Joseph" |
| 20 | +import importlib.metadata |
| 21 | +import datetime |
23 | 22 |
|
| 23 | +DISTRIBUTION_METADATA = importlib.metadata.metadata("stackstac") |
| 24 | + |
| 25 | +author = DISTRIBUTION_METADATA["Author"] |
| 26 | +project = DISTRIBUTION_METADATA["Name"] |
| 27 | +version = DISTRIBUTION_METADATA["Version"] |
| 28 | +copyright = f"{datetime.datetime.now().year}, {author}" |
24 | 29 |
|
25 | 30 | # -- General configuration --------------------------------------------------- |
26 | 31 |
|
|
73 | 78 | # Gotta fight fire with fire. nbsphinx injects their CSS directly into the page... |
74 | 79 | # https://github.com/spatialaudio/nbsphinx/blob/master/src/nbsphinx.py#L437-L683 |
75 | 80 | # so we just inject after it to undo their settings that look bad in dark mode. |
76 | | -nbsphinx_prolog = """ |
| 81 | +nbsphinx_prolog = f""" |
77 | 82 | .. raw:: html |
78 | 83 |
|
79 | 84 | <style> |
80 | | - @media (prefers-color-scheme: dark) { |
| 85 | + @media (prefers-color-scheme: dark) {{ |
81 | 86 | /* input area */ |
82 | | - div.nbinput.container div.input_area { |
| 87 | + div.nbinput.container div.input_area {{ |
83 | 88 | border: unset; |
84 | 89 | border-radius: unset; |
85 | | - } |
86 | | - } |
| 90 | + }} |
| 91 | + }} |
87 | 92 |
|
88 | 93 | </style> |
89 | 94 |
|
90 | | -{% set docname = env.doc2path(env.docname, base=False) %} |
| 95 | +{{% set docname = env.doc2path(env.docname, base=False) %}} |
91 | 96 | .. note:: |
92 | | - You can view & download the original notebook |
93 | | - `on Github <https://github.com/gjoseph92/stackstac/blob/main/docs/{{ |
| 97 | + You can run this notebook interactively: |Binder|, or view & download the original |
| 98 | + `on GitHub <https://github.com/gjoseph92/stackstac/blob/v{version}/docs/{{{{ |
94 | 99 | "../" + docname if docname.startswith("examples") else docname |
95 | | - }}>`_. |
| 100 | + }}}}>`_. |
96 | 101 |
|
97 | | - Or, `click here <https://cloud.coiled.io/gjoseph92/jobs/stackstac>`_ |
98 | | - to run these notebooks on Coiled with access to Dask clusters. |
| 102 | +.. |Binder| image:: https://mybinder.org/badge_logo.svg |
| 103 | + :target: https://mybinder.org/v2/gh/gjoseph92/stackstac/v{version}?urlpath=lab/tree/docs/{{{{ |
| 104 | + "../" + docname if docname.startswith("examples") else docname |
| 105 | + }}}} |
99 | 106 | """ |
100 | 107 |
|
101 | | -# TODO enable binder once Coiled supports websocket clusters over 443. |
102 | | -# (Binder blocks outbound traffic on all ports besides 22, 80, and 443, so we can't connect to Coiled on 8786.) |
103 | | -# nbsphinx_prolog = """ |
104 | | -# {% set docname = env.doc2path(env.docname, base=False) %} |
105 | | -# .. note:: |
106 | | -# You can run this notebook interactively here: |Binder|, or view & download the original |
107 | | -# `on Github <https://github.com/gjoseph92/stackstac/blob/main/docs/{{ docname }}>`_. |
108 | | - |
109 | | -# .. |Binder| image:: https://mybinder.org/badge_logo.svg |
110 | | -# :target: https://mybinder.org/v2/gh/gjoseph92/stackstac/main?urlpath=lab/tree/docs/{{ docname }} |
111 | | -# """ |
112 | | - |
113 | 108 |
|
114 | 109 | # Add any paths that contain custom static files (such as style sheets) here, |
115 | 110 | # relative to this directory. They are copied after the builtin static files, |
|
0 commit comments