Skip to content

Commit 31ea12f

Browse files
pllimksunden
andauthored
FEAT: Use pydata-sphinx-theme in conf/v2.py (#59)
* FEAT: Use pydata-sphinx-theme in conf/v2.py * Update changelog_links.py * Fix globaltoc settings and moved custom.css stuff downstream. Customize copy button to not copy code prompt or output. Misc v2 fixes. * Dial it down from 11 by not introducing breaking change to the status quo. Also remove deprecated function from v2. * Add v2 to CI * Add test for v2 * Remove main index sidebar because it is repetitive --------- Co-authored-by: Kyle Sunden <[email protected]>
1 parent 8c4d789 commit 31ea12f

File tree

11 files changed

+474
-8
lines changed

11 files changed

+474
-8
lines changed

.github/workflows/python-tests.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,19 @@ jobs:
3232
- os: ubuntu-latest
3333
python-version: "3.11"
3434
toxenv: py311-test-sphinx60
35+
- os: ubuntu-latest
36+
python-version: "3.11"
37+
toxenv: py311-test-v2deps-sphinx70
3538
- os: macos-latest
3639
python-version: "3.11"
3740
toxenv: py311-test-sphinxdev
3841

3942
steps:
40-
- uses: actions/checkout@v2
43+
- uses: actions/checkout@v3
4144
with:
4245
fetch-depth: 0
4346
- name: Set up Python ${{ matrix.python-version }}
44-
uses: actions/setup-python@v2
47+
uses: actions/setup-python@v4
4548
with:
4649
python-version: ${{ matrix.python-version }}
4750
- name: Install Tox

CHANGES.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Changes in sphinx-astropy
44
1.9 (unreleased)
55
----------------
66

7+
- To switch to ``pydata-sphinx-theme``, use ``sphinx_astropy.conf.v2``
8+
and install the ``[v2]`` optional dependencies. [#59]
9+
710
- Update minimum required version of Sphinx to 3.0.0. [#57]
811

912
- ``check_sphinx_version`` is deprecated. [#57]

LICENSE.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2014-2021, Astropy Developers
1+
Copyright (c) 2014-2023, Astropy Developers
22

33
All rights reserved.
44

README.rst

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Installing **sphinx-astropy** will automatically install (if not already present
3737

3838
* `Sphinx <http://www.sphinx-doc.org>`_
3939

40-
* `astropy-sphinx-theme <https://github.com/astropy/astropy-sphinx-theme>`_ - the default 'bootstrap' theme use by Astropy and a number of affilited packages.
40+
* `astropy-sphinx-theme <https://github.com/astropy/astropy-sphinx-theme>`_ - the default 'bootstrap' theme use by Astropy and a number of affiliated packages. This goes with `sphinx_astropy.conf.v1`.
4141

4242
* `sphinx-automodapi <http://sphinx-automodapi.readthedocs.io>`_ - an extension that makes it easy to automatically generate API documentation.
4343

@@ -49,3 +49,19 @@ Installing **sphinx-astropy** will automatically install (if not already present
4949
images, used by some examples in the astropy core documentation.
5050

5151
* `pytest-doctestplus <https://github.com/astropy/pytest-doctestplus/>`_ - providing the 'doctestplus' extension to skip code snippets in narrative documentation.
52+
53+
pydata-sphinx-theme (v2)
54+
^^^^^^^^^^^^^^^^^^^^^^^^
55+
56+
To use the new `pydata-sphinx-theme` with `sphinx_astropy.conf.v2`, you have to install
57+
the optional `[v2]` dependencies::
58+
59+
pip install sphinx-astropy[v2]
60+
61+
That would pull in the following as well:
62+
63+
* `pydata-sphinx-theme <https://github.com/pydata/pydata-sphinx-theme/>`_ - a clean, three-column,
64+
Bootstrap-based Sphinx theme by and for the `PyData community <https://pydata.org/>`_.
65+
66+
* `sphinx-copybutton <https://github.com/executablebooks/sphinx-copybutton>`_ - a small Sphinx
67+
extension to add a "copy" button to code blocks.

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ install_requires =
3030
pytest-doctestplus>=0.11
3131

3232
[options.extras_require]
33+
v2 =
34+
pydata-sphinx-theme
35+
sphinx-copybutton
3336
all = astropy
3437
tests = pytest
3538

sphinx_astropy/conf/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@
1717
# v2.py file (either starting from a copy of v1.py or starting from
1818
# scratch), and change the import below to 'from .v2 import *'.
1919

20-
from .v1 import *
20+
# TODO: Switch default to v2
21+
from .v1 import * # noqa: F401, F403

0 commit comments

Comments
 (0)