Skip to content

Commit 0bd2b35

Browse files
AA-Turnerbitprophet
authored andcommitted
Require Sphinx 1.6 or newer
1 parent 5e563d6 commit 0bd2b35

File tree

3 files changed

+14
-38
lines changed

3 files changed

+14
-38
lines changed

alabaster/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ def update_context(app, pagename, templatename, context, doctree):
1616

1717

1818
def setup(app):
19-
# add_html_theme is new in Sphinx 1.6+
20-
if hasattr(app, "add_html_theme"):
21-
theme_path = os.path.abspath(os.path.dirname(__file__))
22-
app.add_html_theme("alabaster", theme_path)
19+
app.require_sphinx("1.6")
20+
theme_path = os.path.abspath(os.path.dirname(__file__))
21+
app.add_html_theme("alabaster", theme_path)
2322
app.connect("html-page-context", update_context)
2423
return {"version": version.__version__, "parallel_read_safe": True}

dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
sphinx>=1.3,<1.8
1+
sphinx>=1.6
22
invoke>=1.0.0
33
invocations>=1.2.0
44
semantic_version>=2.4,<2.5

docs/installation.rst

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,20 @@
22
Installation
33
============
44

5-
The bare minimum required to install Alabaster is as follows:
5+
Alabaster requires **Sphinx 1.6 or newer**, and is included as the default
6+
theme.
67

7-
* If you're on **Sphinx 1.2 or older**:
8+
.. note::
9+
If you distribute your documentation via `Read the Docs
10+
<https://readthedocs.org>`_, you will need to explicitly enable
11+
Alabaster by adding this line to your ``conf.py``::
812

9-
* ``pip install alabaster`` or equivalent.
10-
* Add the following to your ``conf.py`` so Alabaster's theme location &
11-
mini-extension are located & loaded:
13+
.. code:: python
1214
13-
.. code-block:: python
15+
html_theme = 'alabaster'
1416
15-
import alabaster
16-
17-
html_theme_path = [alabaster.get_path()]
18-
extensions = ['alabaster']
19-
html_theme = 'alabaster'
20-
21-
* If you've installed Alabaster by hand (without using ``pip``) and/or are
22-
doing funky things to your PYTHONPATH, you may need to replace the
23-
``alabaster.get_path()`` call with your own explicit string, as per `the
24-
Sphinx config docs
25-
<http://sphinx-doc.org/config.html#confval-html_theme_path>`_.
26-
27-
* If you have **Sphinx 1.3 or above**:
28-
29-
* You already have Alabaster installed as a dependency! No need to manually
30-
install it or explicitly load it.
31-
32-
.. note::
33-
If you distribute your documentation via the excellent `Read the Docs
34-
<https://readthedocs.org>`_, you may need to explicitly enable
35-
Alabaster (as RTD defaults to using its own theme) by adding this line
36-
to your ``conf.py``::
37-
38-
html_theme = 'alabaster'
39-
40-
* **Either way**, add an explicit ``html_sidebars`` setting so Alabaster's
41-
customized sidebar templates are loaded:
17+
To set-up Alabaster, add an explicit ``html_sidebars`` setting so
18+
Alabaster's customized sidebar templates are loaded:
4219

4320
.. code-block:: python
4421

0 commit comments

Comments
 (0)