From e26a94778b99fbe55ee84b9aab64f23670a1b5c9 Mon Sep 17 00:00:00 2001 From: Dave Shawley Date: Wed, 15 Sep 2021 06:58:21 -0400 Subject: [PATCH] Using sphinx-rtd-theme locally as well. --- docs/conf.py | 26 ++++++++++++-------------- docs/static/custom.css | 32 -------------------------------- setup.cfg | 8 +++++++- 3 files changed, 19 insertions(+), 47 deletions(-) delete mode 100644 docs/static/custom.css diff --git a/docs/conf.py b/docs/conf.py index 714f8b0..f75a38b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,37 +1,35 @@ +import os + import pkg_resources -needs_sphinx = '1.0' +needs_sphinx = '4.0' extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinx.ext.intersphinx', 'sphinx.ext.extlinks', - 'sphinxcontrib.autohttp.tornado'] + 'sphinxcontrib.httpdomain'] master_doc = 'index' project = 'sprockets.mixins.mediatype' copyright = '2015-2021, AWeber Communications' release = pkg_resources.get_distribution('sprockets.mixins.mediatype').version version = '.'.join(release.split('.')[0:1]) -html_style = 'custom.css' -html_static_path = ['static'] +# Only install the ReadTheDocs theme when we are not running +# in the RTD build system. +if not os.environ.get('READTHEDOCS', None): + import sphinx_rtd_theme + html_theme = 'sphinx_rtd_theme' + html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] + html_sidebars = { '**': ['about.html', 'navigation.html'], } -html_theme_options = { - 'github_user': 'sprockets', - 'github_repo': 'sprockets.mixins.mediatype', - 'description': 'Content-Type negotation mix-in', - 'github_banner': True, - 'travis_button': True, - 'sidebar_width': '230px', - 'codecov_button': True, -} intersphinx_mapping = { 'python': ('https://docs.python.org/3', None), 'requests': ('https://requests.readthedocs.org/en/latest/', None), 'sprockets': ('https://sprockets.readthedocs.org/en/latest/', None), - 'tornado': ('http://tornadoweb.org/en/latest/', None), + 'tornado': ('https://www.tornadoweb.org/en/stable/', None), } # https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html diff --git a/docs/static/custom.css b/docs/static/custom.css deleted file mode 100644 index 59fb5ed..0000000 --- a/docs/static/custom.css +++ /dev/null @@ -1,32 +0,0 @@ -@import url("alabaster.css"); -h1.logo { - font-size: 12pt; - overflow-wrap: normal; - word-wrap: normal; - overflow: hidden; - margin-right: -25px; /* works together with div.body padding-left */ -} -div.body {padding-left: 30px;} -th.field-name {hyphens: none; -webkit-hyphens: none; -ms-hyphens: none;} -div.document {width: 90%;} -/* support small screens too! */ -@media screen and (max-width: 1000px) { - div.sphinxsidebar {display: none;} - div.document {width: 100%!important;} - div.bodywrapper {margin-left: 0;} - div.highlight pre {margin-right: -30px;} -} -@media screen and (min-width: 1000px) { - div.bodywrapper {margin-left: default;} -} -/* hanging indent for class names - * would use "text-indent: 2em hanging" if it were supported everywhere - */ -dl.class > dt, dl.function > dt { - text-indent: -4em; - padding-left: 4em; -} -/* add some space to wrap nicely */ -span.sig-paren::after { - content: " "; -} diff --git a/setup.cfg b/setup.cfg index fa30768..8ba4f09 100644 --- a/setup.cfg +++ b/setup.cfg @@ -42,8 +42,14 @@ ci = dev = coverage==5.5 flake8==3.9.2 + sphinx==4.2.0 + sphinx-rtd-theme==1.0.0 + sphinxcontrib-httpdomain==1.7.0 tox==3.24.3 - +docs = + sphinx==4.2.0 + sphinx-rtd-theme==1.0.0 + sphinxcontrib-httpdomain==1.7.0 [build_sphinx] fresh-env = 1