1- from importlib import metadata
21from pathlib import Path
3- import os
2+ import importlib . metadata
43import re
5- import sys
64
75ROOT = Path (__file__ ).parent .parent
86PACKAGE_SRC = ROOT / "jsonschema"
97
10- # If extensions (or modules to document with autodoc) are in another directory,
11- # add these directories to sys.path here. If the directory is relative to the
12- # documentation root, use os.path.abspath to make it absolute, like shown here.
13- ext_paths = [os .path .abspath (os .path .pardir ), os .path .dirname (__file__ )]
14- sys .path = ext_paths + sys .path
8+ # -- Project information -----------------------------------------------------
159
16- # -- General configuration -------------------------------------------------
10+ project = "jsonschema"
11+ author = "Julian Berman"
12+ copyright = "2013, " + author
13+
14+ # version: The short X.Y version
15+ # release: The full version, including alpha/beta/rc tags.
16+ release = importlib .metadata .version ("jsonschema" )
17+ version = release .partition ("-" )[0 ]
18+
19+
20+ # -- General configuration ---------------------------------------------------
1721
1822# If your documentation needs a minimal Sphinx version, state it here.
23+ #
1924# needs_sphinx = "1.0"
2025
26+ default_role = "any"
27+
2128# Add any Sphinx extension module names here, as strings. They can be
2229# extensions coming with Sphinx (named "sphinx.ext.*") or your custom
2330# ones.
4350# Add any paths that contain templates here, relative to this directory.
4451templates_path = ["_templates" ]
4552
46- # The suffix of source filenames.
53+ # The suffix(es) of source filenames.
54+ # You can specify multiple suffix as a list of string:
55+ #
56+ # source_suffix = [".rst", ".md"]
4757source_suffix = ".rst"
4858
49- # The encoding of source files.
50- # source_encoding = "utf-8-sig"
51-
5259# The master toctree document.
5360master_doc = "index"
5461
55- # General information about the project.
56- project = "jsonschema"
57- author = "Julian Berman"
58- copyright = "2013, " + author
59-
60- # The version info for the project you're documenting, acts as replacement for
61- # |version| and |release|, also used in various other places throughout the
62- # built documents.
63- #
64- # version: The short X.Y version
65- # release: The full version, including alpha/beta/rc tags.
66- release = metadata .version ("jsonschema" )
67- version = release .partition ("-" )[0 ]
68-
6962# There are two options for replacing |today|: either, you set today to some
7063# non-false value, then it is used:
7164# today = ""
7467
7568# List of patterns, relative to source directory, that match files and
7669# directories to ignore when looking for source files.
70+ # This pattern also affects html_static_path and html_extra_path.
7771exclude_patterns = ["_build" , "_cache" , "_static" , "_templates" ]
7872
79- # The reST default role (used for this markup: `text`) to use for all documents
80- default_role = "any"
81-
8273# The name of the Pygments (syntax highlighting) style to use.
8374pygments_style = "lovelace"
8475pygments_dark_style = "one-dark"
8576
86- # A list of ignored prefixes for module index sorting.
87- # modindex_common_prefix = []
88-
8977doctest_global_setup = """
9078from jsonschema import *
9179"""
10896#
10997# html_theme_options = {}
11098
111- # Add any paths that contain custom themes here, relative to this directory.
112- # html_theme_path = []
113-
114- # The name for this set of Sphinx documents. If None, it defaults to
115- # "<project> v<release> documentation".
116- # html_title = None
117-
118- # A shorter title for the navigation bar. Default is the same as html_title.
119- # html_short_title = None
120-
121- # The name of an image file (relative to this directory) to place at the top
122- # of the sidebar.
123- # html_logo = None
124-
125- # The name of an image file (within the static path) to use as favicon of the
126- # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
127- # pixels large.
128- # html_favicon = None
129-
13099# Add any paths that contain custom static files (such as style sheets) here,
131100# relative to this directory. They are copied after the builtin static files,
132101# so a file named "default.css" will overwrite the builtin "default.css".
133102# html_static_path = ["_static"]
134103
135- # If not "", a "Last updated on:" timestamp is inserted at every page bottom,
136- # using the given strftime format.
137- # html_last_updated_fmt = "%b %d, %Y"
138-
139- # If true, SmartyPants will be used to convert quotes and dashes to
140- # typographically correct entities.
141- # html_use_smartypants = True
142-
143- # Custom sidebar templates, maps document names to template names.
144- # html_sidebars = {}
145-
146- # Additional templates that should be rendered to pages, maps page names to
147- # template names.
148- # html_additional_pages = {}
149-
150- # If false, no module index is generated.
151- # html_domain_indices = True
152-
153- # If false, no index is generated.
154- # html_use_index = True
155-
156- # If true, the index is split into individual pages for each letter.
157- # html_split_index = False
158-
159- # If true, links to the reST sources are added to the pages.
160- # html_show_sourcelink = True
161-
162- # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
163- # html_show_sphinx = True
164104
165- # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
166- # html_show_copyright = True
167-
168- # If true, an OpenSearch description file will be output, and all pages will
169- # contain a <link> tag referring to it. The value of this option must be the
170- # base URL from which the finished HTML is served.
171- # html_use_opensearch = ""
172-
173- # This is the file name suffix for HTML files (e.g. ".xhtml").
174- # html_file_suffix = None
105+ # -- Options for HTMLHelp output ---------------------------------------------
175106
176107# Output file base name for HTML help builder.
177108htmlhelp_basename = "jsonschemadoc"
178109
179110
180- # -- Options for LaTeX output ----------------------------------------------
111+ # -- Options for LaTeX output ------------------------------------------------
181112
182- # Grouping the document tree into LaTeX files. List of tuples (source
183- # start file, target name, title, author, documentclass [howto/manual]).
184113latex_documents = [
185114 ("index" , "jsonschema.tex" , "jsonschema Documentation" , author , "manual" ),
186115]
187116
188- # The name of an image file (relative to this directory) to place at the top of
189- # the title page.
190- # latex_logo = None
191-
192- # For "manual" documents, if this is true, then toplevel headings are parts,
193- # not chapters.
194- # latex_use_parts = False
195-
196- # If true, show page references after internal links.
197- # latex_show_pagerefs = False
198-
199- # If true, show URL addresses after external links.
200- # latex_show_urls = False
201-
202- # Documents to append as an appendix to all manuals.
203- # latex_appendices = []
204117
205- # If false, no module index is generated.
206- # latex_domain_indices = True
207-
208-
209- # -- Options for manual page output ----------------------------------------
118+ # -- Options for manual page output ------------------------------------------
210119
211120# One entry per manual page. List of tuples
212121# (source start file, name, description, authors, manual section).
213122man_pages = [("index" , "jsonschema" , "jsonschema Documentation" , [author ], 1 )]
214123
215- # If true, show URL addresses after external links.
216- # man_show_urls = False
217-
218124
219- # -- Options for Texinfo output --------------------------------------------
125+ # -- Options for Texinfo output ----------------------------------------------
220126
221127# Grouping the document tree into Texinfo files. List of tuples
222128# (source start file, target name, title, author,
233139 ),
234140]
235141
236- # Documents to append as an appendix to all manuals.
237- # texinfo_appendices = []
238-
239- # If false, no module index is generated.
240- # texinfo_domain_indices = True
241-
242- # How to display URL addresses: "footnote", "no", or "inline".
243- # texinfo_show_urls = "footnote"
244-
245- # -- Options for the linkcheck builder ------------------------------------
142+ # -- Options for the linkcheck builder --------------------------------------
246143
247144
248145def entire_domain (host ):
@@ -263,7 +160,7 @@ def entire_domain(host):
263160
264161spelling_word_list_filename = "spelling-wordlist.txt"
265162
266- # -- Options for autoapi --------------------------------------------------
163+ # -- Options for autoapi ----------------------------------------------------
267164
268165suppress_warnings = [
269166 "autoapi.python_import_resolution" ,
0 commit comments