From efdbb29b6c2c7fe87636bd672ce6f9b0e07033a9 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Tue, 14 Nov 2023 23:31:53 -0800 Subject: [PATCH] docs: update rst.linker and sphinx-related configuration --- docs/conf.py | 62 +++++++++++++------------------------------------- pyproject.toml | 2 +- setup.cfg | 3 ++- 3 files changed, 19 insertions(+), 48 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index e3cf8106..01b2a5b8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,64 +1,22 @@ -# -- General configuration ----------------------------------------------------- import os import sys # Use the source tree. sys.path.insert(1, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -# 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.doctest', - 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'jaraco.packaging.sphinx', - 'rst.linker', ] -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix of source filenames. -source_suffix = '.rst' - -# The master toctree document. master_doc = 'index' +html_theme = 'furo' -# General information about the project. -copyright = u'2008-2011, John Paulett; 2009-2020, David Aguilar' - -# List of directories, relative to source directory, that shouldn't be searched -# for source files. -exclude_trees = [] - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# -- Options for HTML output --------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. Major themes that come with -# Sphinx are currently 'default' and 'sphinxdoc'. -html_theme = 'default' - -# Output file base name for HTML help builder. -htmlhelp_basename = 'jsonpickledoc' - - -# -- Options for LaTeX output -------------------------------------------------- - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass [howto/manual]). -latex_documents = [ - ('index', 'jsonpickle.tex', 'jsonpickle Documentation', 'David Aguilar', 'manual'), -] - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {'https://docs.python.org/3': None} - - +# Link dates and other references in the changelog +extensions += ['rst.linker'] link_files = { '../CHANGES.rst': dict( using=dict(GH='https://github.com'), @@ -72,7 +30,7 @@ url='{package_url}/pull/{pull}', ), dict( - pattern=r'^(?m)((?Pv?\d+(\.\d+){1,2}))\n[-=]+\n', + pattern=r'(?m:^((?Pv?\d+(\.\d+){1,2}))\n[-=]+\n)', with_scm='{text}\n{rev[timestamp]:%d %b %Y}\n', ), dict( @@ -82,3 +40,15 @@ ], ) } + +# Be strict about any broken references +nitpicky = True + +extensions += ['sphinx.ext.intersphinx'] +intersphinx_mapping = { + 'python': ('https://docs.python.org/3', None), + 'sphinx': ('https://www.sphinx-doc.org/en/stable/', None), +} + +# Preserve authored syntax for defaults +autodoc_preserve_defaults = True diff --git a/pyproject.toml b/pyproject.toml index 6a3b3367..dce944df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=42", "setuptools_scm[toml]>=3.4.1"] +requires = ["setuptools>=56", "setuptools_scm[toml]>=3.4.1"] build-backend = "setuptools.build_meta" [tool.black] diff --git a/setup.cfg b/setup.cfg index 9a5f6baa..f27e0620 100644 --- a/setup.cfg +++ b/setup.cfg @@ -71,8 +71,9 @@ testing.libs = docs = # upstream sphinx - jaraco.packaging >= 3.2 + jaraco.packaging >= 9.3 rst.linker >= 1.9 + furo # local