diff --git a/changelog.d/166.misc.rst b/changelog.d/166.misc.rst new file mode 100644 index 00000000..438852ba --- /dev/null +++ b/changelog.d/166.misc.rst @@ -0,0 +1 @@ +* Changed the documentation theme to Alabaster diff --git a/doc/conf.py b/doc/conf.py index 9ec8a304..0a6b43d4 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -12,12 +12,12 @@ # serve to show the default. import sys, os -import sphinx_rtd_theme +import alabaster # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) +sys.path.insert(0, os.path.abspath("../src")) from hamcrest import __version__ @@ -28,9 +28,10 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ["sphinx.ext.autodoc", "sphinx.ext.intersphinx"] +extensions = ["sphinx.ext.autodoc", "sphinx.ext.intersphinx", "alabaster"] autodoc_default_options = {"members": None, "show-inheritance": None} +autodoc_typehints = "description" intersphinx_mapping = {"python": ("http://docs.python.org/3", None)} # Add any paths that contain templates here, relative to this directory. @@ -53,10 +54,11 @@ # |version| and |release|, also used in various other places throughout the # built documents. # -# The short X.Y version. -version = __version__ # The full version, including alpha/beta/rc tags. -release = __version__ +version = __version__ + +# The short X.Y version. +release = ".".join(version.split(".")[:2]) # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -97,7 +99,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = "sphinx_rtd_theme" +html_theme = "alabaster" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -106,7 +108,7 @@ # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] -html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] +html_theme_path = [alabaster.get_path()] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". diff --git a/setup.py b/setup.py index 1f462338..e9dfa39a 100755 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ def read(fname): assert __version__ is not None -REQUIREMENTS_DOCS = ["sphinx~=3.0", "sphinx_rtd_theme~=0.4"] +REQUIREMENTS_DOCS = ["sphinx~=3.0", "alabaster~=0.7"] TESTS_BASIC = ["pytest>=5.0", "pytest-sugar", "coverage"] TESTS_NUMPY = ["numpy"] DEV_TOOLS = [