Show More
@@ -15,11 +15,17 b'' | |||||
15 | # All configuration values have a default value; values that are commented out |
|
15 | # All configuration values have a default value; values that are commented out | |
16 | # serve to show the default value. |
|
16 | # serve to show the default value. | |
17 |
|
17 | |||
18 | import toml |
|
18 | ||
19 | import sys, os |
|
19 | import sys, os | |
20 | from pathlib import Path |
|
20 | from pathlib import Path | |
21 |
|
21 | |||
22 | config = toml.load("./sphinx.toml") |
|
22 | if sys.version_info > (3, 11): | |
|
23 | import tomllib | |||
|
24 | else: | |||
|
25 | import tomli as tomllib | |||
|
26 | ||||
|
27 | with open("./sphinx.toml", "rb") as f: | |||
|
28 | config = tomllib.load(f) | |||
23 |
|
29 | |||
24 | # https://read-the-docs.readthedocs.io/en/latest/faq.html |
|
30 | # https://read-the-docs.readthedocs.io/en/latest/faq.html | |
25 | ON_RTD = os.environ.get("READTHEDOCS", None) == "True" |
|
31 | ON_RTD = os.environ.get("READTHEDOCS", None) == "True" | |
@@ -68,28 +74,23 b' exec(' | |||||
68 | # General configuration |
|
74 | # General configuration | |
69 | # --------------------- |
|
75 | # --------------------- | |
70 |
|
76 | |||
71 | # Add any paths that contain templates here, relative to this directory. |
|
77 | # - template_path: Add any paths that contain templates here, relative to this directory. | |
72 | templates_path = config["sphinx"]["templates_path"] |
|
78 | # - master_doc: The master toctree document. | |
73 | # The master toctree document. |
|
79 | # - project | |
74 | master_doc = config["sphinx"]["master_doc"] |
|
80 | # - copyright | |
75 | # General substitutions. |
|
81 | # - github_project_url | |
76 |
|
|
82 | # - source_suffix = config["sphinx"]["source_suffix"] | |
77 | copyright = config["sphinx"]["copyright"] |
|
83 | # - exclude_patterns: | |
78 | # ghissue config |
|
84 | # Exclude these glob-style patterns when looking for source files. | |
79 | github_project_url = config["sphinx"]["github_project_url"] |
|
85 | # They are relative to the source/ directory. | |
80 | # The suffix of source filenames. |
|
86 | # - pygments_style: The name of the Pygments (syntax highlighting) style to use. | |
81 | source_suffix = config["sphinx"]["source_suffix"] |
|
87 | # - extensions: | |
82 | # Exclude these glob-style patterns when looking for source files. They are |
|
88 | # Add any Sphinx extension module names here, as strings. They can be extensions | |
83 | # relative to the source/ directory. |
|
89 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. | |
84 | exclude_patterns = config["sphinx"]["exclude_patterns"] |
|
90 | # - default_role | |
85 | # The name of the Pygments (syntax highlighting) style to use. |
|
91 | # - modindex_common_prefix | |
86 | pygments_style = config["sphinx"]["pygments_style"] |
|
92 | ||
87 | # Add any Sphinx extension module names here, as strings. They can be extensions |
|
93 | locals().update(config["sphinx"]) | |
88 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. |
|
|||
89 | extensions = config["sphinx"]["extensions"] |
|
|||
90 | # Set the default role so we can use `foo` instead of ``foo`` |
|
|||
91 | default_role = config["sphinx"]["default_role"] |
|
|||
92 | modindex_common_prefix = config["sphinx"]["modindex_common_prefix"] |
|
|||
93 |
|
94 | |||
94 | intersphinx_mapping = config["intersphinx_mapping"] |
|
95 | intersphinx_mapping = config["intersphinx_mapping"] | |
95 | for k, v in intersphinx_mapping.items(): |
|
96 | for k, v in intersphinx_mapping.items(): | |
@@ -106,20 +107,20 b' warning_is_error = config["numpydoc"]["warning_is_error"]' | |||||
106 |
|
107 | |||
107 | # Options for HTML output |
|
108 | # Options for HTML output | |
108 | # ----------------------- |
|
109 | # ----------------------- | |
109 | html_theme = config["html"]["html_theme"] |
|
|||
110 | html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] |
|
110 | html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] | |
111 |
|
111 | # - html_theme | ||
112 | # Add any paths that contain custom static files (such as style sheets) here, |
|
112 | # - html_static_path | |
113 | # relative to this directory. They are copied after the builtin static files, |
|
113 | # Add any paths that contain custom static files (such as style sheets) here, | |
114 | # so a file named "default.css" will overwrite the builtin "default.css". |
|
114 | # relative to this directory. They are copied after the builtin static files, | |
115 | html_static_path = config["html"]["html_static_path"] |
|
115 | # so a file named "default.css" will overwrite the builtin "default.css". | |
116 | # Favicon needs the directory name |
|
116 | # Favicon needs the directory name | |
117 | html_favicon = config["html"]["html_favicon"] |
|
117 | # - html_favicon | |
118 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, |
|
118 | # - html_last_updated_fmt = config["html"]["html_last_updated_fmt"] | |
119 | # using the given strftime format. |
|
119 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, | |
120 | html_last_updated_fmt = config["html"]["html_last_updated_fmt"] |
|
120 | # using the given strftime format. | |
121 | # Output file base name for HTML help builder. |
|
121 | # Output file base name for HTML help builder. | |
122 | htmlhelp_basename = config["html"]["htmlhelp_basename"] |
|
122 | # - htmlhelp_basename | |
|
123 | locals().update(config["html"]) | |||
123 |
|
124 | |||
124 | # Additional templates that should be rendered to pages, maps page names to |
|
125 | # Additional templates that should be rendered to pages, maps page names to | |
125 | # template names. |
|
126 | # template names. |
@@ -61,18 +61,18 b' black = [' | |||||
61 | "black", |
|
61 | "black", | |
62 | ] |
|
62 | ] | |
63 | doc = [ |
|
63 | doc = [ | |
|
64 | "docrepr", | |||
|
65 | "exceptiongroup", | |||
64 | "ipykernel", |
|
66 | "ipykernel", | |
|
67 | "ipython[test]", | |||
|
68 | "matplotlib", | |||
65 | "setuptools>=18.5", |
|
69 | "setuptools>=18.5", | |
66 | "sphinx>=1.3", |
|
|||
67 | "sphinx-rtd-theme", |
|
70 | "sphinx-rtd-theme", | |
|
71 | "sphinx>=1.3", | |||
68 | "sphinxcontrib-jquery", |
|
72 | "sphinxcontrib-jquery", | |
69 | "docrepr", |
|
|||
70 | "matplotlib", |
|
|||
71 | "stack_data", |
|
73 | "stack_data", | |
|
74 | "tomli ; python_version<'3.11'", | |||
72 | "typing_extensions", |
|
75 | "typing_extensions", | |
73 | "exceptiongroup", |
|
|||
74 | "ipython[test]", |
|
|||
75 | "toml", |
|
|||
76 | ] |
|
76 | ] | |
77 | kernel = [ |
|
77 | kernel = [ | |
78 | "ipykernel", |
|
78 | "ipykernel", |
General Comments 0
You need to be logged in to leave comments.
Login now