From 6e2e70ab803e14bdf4b07eddbb5385d01be80cbc Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 17 Feb 2023 08:31:57 -0600 Subject: [PATCH] PYTHON-3381 Improve readability of sphinx docs (#1156) --- .pre-commit-config.yaml | 2 +- doc/changelog.rst | 6 ------ doc/common-issues.rst | 2 -- doc/conf.py | 18 +++++++++++------- doc/docs-requirements.txt | 3 ++- doc/faq.rst | 2 -- doc/migrate-to-pymongo4.rst | 2 -- doc/python3.rst | 2 -- 8 files changed, 14 insertions(+), 23 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cfe0db31c..f0ee74c78 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: args: [--line-length=100] - repo: https://github.com/PyCQA/isort - rev: 5.10.1 + rev: 5.12.0 hooks: - id: isort files: \.py$ diff --git a/doc/changelog.rst b/doc/changelog.rst index 6a6e6fef2..2ad33e41e 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -3519,9 +3519,3 @@ Changes in Version 0.9.7 :class:`~pymongo.collection.Collection` names - add version as :attr:`pymongo.version` - add ``--no_ext`` command line option to *setup.py* - -.. toctree:: - :hidden: - - python3 - examples/gevent diff --git a/doc/common-issues.rst b/doc/common-issues.rst index 1571b985e..f0c971668 100644 --- a/doc/common-issues.rst +++ b/doc/common-issues.rst @@ -3,8 +3,6 @@ Frequently Encountered Issues Also see the :ref:`TLSErrors` section. -.. contents:: - Server reports wire version X, PyMongo requires Y ------------------------------------------------- diff --git a/doc/conf.py b/doc/conf.py index f66de3868..cbb525b41 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -32,7 +32,6 @@ try: except ImportError: pass - # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] @@ -108,13 +107,18 @@ db = client.doctest_test # -- Options for HTML output --------------------------------------------------- -# Theme gratefully vendored from CPython source. -html_theme = "pydoctheme" -html_theme_path = ["."] -html_theme_options = {"collapsiblesidebar": True, "googletag": False} +try: + import furo # noqa -# Additional static files. -html_static_path = ["static"] + html_theme = "furo" +except ImportError: + # Theme gratefully vendored from CPython source. + html_theme = "pydoctheme" + html_theme_path = ["."] + html_theme_options = {"collapsiblesidebar": True, "googletag": False} + + # Additional static files. + html_static_path = ["static"] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". diff --git a/doc/docs-requirements.txt b/doc/docs-requirements.txt index 455a47d21..3c6696285 100644 --- a/doc/docs-requirements.txt +++ b/doc/docs-requirements.txt @@ -1,4 +1,5 @@ -Sphinx~=4.2 +Sphinx~=6.1 sphinx_rtd_theme~=0.5 readthedocs-sphinx-search~=0.1 sphinxcontrib-shellcheck~=1.1 +furo==2022.12.7 diff --git a/doc/faq.rst b/doc/faq.rst index acf557a81..876dc68ed 100644 --- a/doc/faq.rst +++ b/doc/faq.rst @@ -1,8 +1,6 @@ Frequently Asked Questions ========================== -.. contents:: - Is PyMongo thread-safe? ----------------------- diff --git a/doc/migrate-to-pymongo4.rst b/doc/migrate-to-pymongo4.rst index 5843a2261..561261c7a 100644 --- a/doc/migrate-to-pymongo4.rst +++ b/doc/migrate-to-pymongo4.rst @@ -3,8 +3,6 @@ PyMongo 4 Migration Guide ========================= -.. contents:: - .. testsetup:: from pymongo import MongoClient, ReadPreference diff --git a/doc/python3.rst b/doc/python3.rst index 812bc33b3..40d5fec66 100644 --- a/doc/python3.rst +++ b/doc/python3.rst @@ -1,8 +1,6 @@ Python 3 FAQ ============ -.. contents:: - What Python 3 versions are supported? -------------------------------------