Skip to content

Commit d09ec6a

Browse files
committed
Simplify Sphinx config
1 parent 9598515 commit d09ec6a

File tree

2 files changed

+39
-238
lines changed

2 files changed

+39
-238
lines changed

docs/conf.py

Lines changed: 4 additions & 203 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313

1414
# If extensions (or modules to document with autodoc) are in another directory,
1515
# add these directories to sys.path here. If the directory is relative to the
16-
# documentation root, use os.path.abspath to make it absolute, like shown here.
16+
# documentation root, use Path.resolve() to make it absolute, like shown here.
1717
#
18-
import os
1918
import sys
19+
from pathlib import Path
2020

2121
# Make src layout importable without installation
22-
sys.path.insert(0, os.path.abspath("../src"))
22+
sys.path.insert(0, str(Path(__file__).parent.parent / "src"))
2323

2424
# -- General configuration ------------------------------------------------
2525

2626
# If your documentation needs a minimal Sphinx version, state it here.
2727
#
28-
# needs_sphinx = '1.0'
28+
needs_sphinx = "9.0"
2929

3030
# Add any Sphinx extension module names here, as strings. They can be
3131
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
@@ -37,16 +37,6 @@
3737
# Add any paths that contain templates here, relative to this directory.
3838
templates_path = ["_templates"]
3939

40-
# The suffix(es) of source filenames.
41-
# You can specify multiple suffix as a list of string:
42-
#
43-
# source_suffix = ['.rst', '.md']
44-
source_suffix = ".rst"
45-
46-
# The encoding of source files.
47-
#
48-
# source_encoding = 'utf-8-sig'
49-
5040
# The master toctree document.
5141
master_doc = "index"
5242

@@ -71,15 +61,6 @@
7161
# Usually you set "language" from the command line for these cases.
7262
language = "en"
7363

74-
# There are two options for replacing |today|: either, you set today to some
75-
# non-false value, then it is used:
76-
#
77-
# today = ''
78-
#
79-
# Else, today_fmt is used as the format for a strftime call.
80-
#
81-
# today_fmt = '%B %d, %Y'
82-
8364
# List of patterns, relative to source directory, that match files and
8465
# directories to ignore when looking for source files.
8566
# This patterns also effect to html_static_path and html_extra_path
@@ -121,38 +102,9 @@
121102
# but not too nitpicky
122103
suppress_warnings = ["ref.class", "ref.obj", "ref.python"]
123104

124-
125-
# The reST default role (used for this markup: `text`) to use for all
126-
# documents.
127-
#
128-
# default_role = None
129-
130-
# If true, '()' will be appended to :func: etc. cross-reference text.
131-
#
132-
# add_function_parentheses = True
133-
134-
# If true, the current module name will be prepended to all description
135-
# unit titles (such as .. function::).
136-
#
137-
# add_module_names = True
138-
139-
# If true, sectionauthor and moduleauthor directives will be shown in the
140-
# output. They are ignored by default.
141-
#
142-
# show_authors = False
143-
144105
# The name of the Pygments (syntax highlighting) style to use.
145106
pygments_style = "sphinx"
146107

147-
# A list of ignored prefixes for module index sorting.
148-
# modindex_common_prefix = []
149-
150-
# If true, keep warnings as "system message" paragraphs in the built documents.
151-
# keep_warnings = False
152-
153-
# If true, `todo` and `todoList` produce output, else they produce nothing.
154-
todo_include_todos = False
155-
156108
# -- Options for HTML output ----------------------------------------------
157109

158110
# The theme to use for HTML and HTML Help pages. See the documentation for
@@ -166,72 +118,6 @@
166118
#
167119
html_theme_options = {"navigation_depth": 5}
168120

169-
# Add any paths that contain custom themes here, relative to this directory.
170-
# html_theme_path = []
171-
172-
# The name for this set of Sphinx documents.
173-
# "<project> v<release> documentation" by default.
174-
#
175-
# html_title = 'GraphQL-core v3.1.0'
176-
177-
# A shorter title for the navigation bar. Default is the same as html_title.
178-
#
179-
# html_short_title = None
180-
181-
# The name of an image file (relative to this directory) to place at the top
182-
# of the sidebar.
183-
#
184-
# html_logo = None
185-
186-
# The name of an image file (relative to this directory) to use as a favicon of
187-
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
188-
# pixels large.
189-
#
190-
# html_favicon = None
191-
192-
# Add any paths that contain custom static files (such as style sheets) here,
193-
# relative to this directory. They are copied after the builtin static files,
194-
# so a file named "default.css" will overwrite the builtin "default.css".
195-
# html_static_path = ['_static']
196-
197-
# Add any extra paths that contain custom files (such as robots.txt or
198-
# .htaccess) here, relative to this directory. These files are copied
199-
# directly to the root of the documentation.
200-
#
201-
# html_extra_path = []
202-
203-
# If not None, a 'Last updated on:' timestamp is inserted at every page
204-
# bottom, using the given strftime format.
205-
# The empty string is equivalent to '%b %d, %Y'.
206-
#
207-
# html_last_updated_fmt = None
208-
209-
# If true, SmartyPants will be used to convert quotes and dashes to
210-
# typographically correct entities.
211-
#
212-
# html_use_smartypants = True
213-
214-
# Custom sidebar templates, maps document names to template names.
215-
#
216-
# html_sidebars = {}
217-
218-
# Additional templates that should be rendered to pages, maps page names to
219-
# template names.
220-
#
221-
# html_additional_pages = {}
222-
223-
# If false, no module index is generated.
224-
#
225-
# html_domain_indices = True
226-
227-
# If false, no index is generated.
228-
#
229-
# html_use_index = True
230-
231-
# If true, the index is split into individual pages for each letter.
232-
#
233-
# html_split_index = False
234-
235121
# If true, links to the reST sources are added to the pages.
236122
#
237123
html_show_sourcelink = False
@@ -244,53 +130,11 @@
244130
#
245131
# html_show_copyright = True
246132

247-
# If true, an OpenSearch description file will be output, and all pages will
248-
# contain a <link> tag referring to it. The value of this option must be the
249-
# base URL from which the finished HTML is served.
250-
#
251-
# html_use_opensearch = ''
252-
253-
# This is the file name suffix for HTML files (e.g. ".xhtml").
254-
# html_file_suffix = None
255-
256-
# Language to be used for generating the HTML full-text search index.
257-
# Sphinx supports the following languages:
258-
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
259-
# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh'
260-
#
261-
# html_search_language = 'en'
262-
263-
# A dictionary with options for the search language support, empty by default.
264-
# 'ja' uses this config value.
265-
# 'zh' user can custom change `jieba` dictionary path.
266-
#
267-
# html_search_options = {'type': 'default'}
268-
269-
# The name of a javascript file (relative to the configuration directory) that
270-
# implements a search results scorer. If empty, the default will be used.
271-
#
272-
# html_search_scorer = 'scorer.js'
273-
274133
# Output file base name for HTML help builder.
275134
htmlhelp_basename = "GraphQL-core-3-doc"
276135

277136
# -- Options for LaTeX output ---------------------------------------------
278137

279-
latex_elements = {
280-
# The paper size ('letterpaper' or 'a4paper').
281-
#
282-
# 'papersize': 'letterpaper',
283-
# The font size ('10pt', '11pt' or '12pt').
284-
#
285-
# 'pointsize': '10pt',
286-
# Additional stuff for the LaTeX preamble.
287-
#
288-
# 'preamble': '',
289-
# Latex figure (float) alignment
290-
#
291-
# 'figure_align': 'htbp',
292-
}
293-
294138
# Grouping the document tree into LaTeX files. List of tuples
295139
# (source start file, target name, title,
296140
# author, documentclass [howto, manual, or own class]).
@@ -304,33 +148,6 @@
304148
),
305149
]
306150

307-
# The name of an image file (relative to this directory) to place at the top of
308-
# the title page.
309-
#
310-
# latex_logo = None
311-
312-
# For "manual" documents, if this is true, then toplevel headings are parts,
313-
# not chapters.
314-
#
315-
# latex_use_parts = False
316-
317-
# If true, show page references after internal links.
318-
#
319-
# latex_show_pagerefs = False
320-
321-
# If true, show URL addresses after external links.
322-
#
323-
# latex_show_urls = False
324-
325-
# Documents to append as an appendix to all manuals.
326-
#
327-
# latex_appendices = []
328-
329-
# If false, no module index is generated.
330-
#
331-
# latex_domain_indices = True
332-
333-
334151
# -- Options for manual page output ---------------------------------------
335152

336153
# One entry per manual page. List of tuples
@@ -358,19 +175,3 @@
358175
"Miscellaneous",
359176
),
360177
]
361-
362-
# Documents to append as an appendix to all manuals.
363-
#
364-
# texinfo_appendices = []
365-
366-
# If false, no module index is generated.
367-
#
368-
# texinfo_domain_indices = True
369-
370-
# How to display URL addresses: 'footnote', 'no', or 'inline'.
371-
#
372-
# texinfo_show_urls = 'footnote'
373-
374-
# If true, do not generate a @detailmenu in the "Top" node's menu.
375-
#
376-
# texinfo_no_detailmenu = False

docs/make.bat

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
@ECHO OFF
2-
3-
pushd %~dp0
4-
5-
REM Command file for Sphinx documentation
6-
7-
if "%SPHINXBUILD%" == "" (
8-
set SPHINXBUILD=sphinx-build
9-
)
10-
set SOURCEDIR=.
11-
set BUILDDIR=_build
12-
13-
if "%1" == "" goto help
14-
15-
%SPHINXBUILD% >NUL 2>NUL
16-
if errorlevel 9009 (
17-
echo.
18-
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19-
echo.installed, then set the SPHINXBUILD environment variable to point
20-
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21-
echo.may add the Sphinx directory to PATH.
22-
echo.
23-
echo.If you don't have Sphinx installed, grab it from
24-
echo.http://sphinx-doc.org/
25-
exit /b 1
26-
)
27-
28-
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29-
goto end
30-
31-
:help
32-
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33-
34-
:end
35-
popd
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

0 commit comments

Comments
 (0)