|
6 | 6 |
|
7 | 7 | # standard imports |
8 | 8 | from datetime import datetime |
| 9 | +import os |
| 10 | +import sys |
9 | 11 |
|
10 | 12 |
|
11 | 13 | # -- Path setup -------------------------------------------------------------- |
12 | 14 |
|
13 | 15 | # If extensions (or modules to document with autodoc) are in another directory, |
14 | 16 | # add these directories to sys.path here. If the directory is relative to the |
15 | 17 | # documentation root, use os.path.abspath to make it absolute, like shown here. |
16 | | -import os |
17 | | -import sys |
18 | 18 |
|
19 | 19 | script_dir = os.path.dirname(os.path.abspath(__file__)) # the directory of this file |
20 | 20 | source_dir = os.path.dirname(script_dir) # the source folder directory |
21 | 21 | root_dir = os.path.dirname(source_dir) # the root folder directory |
| 22 | +src_dir = os.path.join(root_dir, 'src') # the src folder directory |
22 | 23 |
|
23 | 24 | try: |
24 | | - sys.path.insert(0, root_dir) |
25 | | - from pyra import definitions # put this in a try/except to prevent flake8 warning |
26 | | -except Exception: |
| 25 | + sys.path.insert(0, src_dir) |
| 26 | + from common import definitions # put this in a try/except to prevent flake8 warning |
| 27 | +except Exception as e: |
| 28 | + print(f"Unable to import definitions from {root_dir}: {e}") |
27 | 29 | sys.exit(1) |
28 | 30 |
|
29 | 31 | # -- Project information ----------------------------------------------------- |
30 | 32 | project = definitions.Names().name |
31 | | -project_copyright = f'{datetime.now ().year}, {project}' |
| 33 | +project_copyright = f'{datetime.now().year}, {project}' |
32 | 34 | author = 'ReenigneArcher' |
33 | 35 |
|
34 | 36 | # The full version, including alpha/beta/rc tags |
|
42 | 44 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
43 | 45 | # ones. |
44 | 46 | extensions = [ |
45 | | - 'm2r2', # enable markdown files |
| 47 | + 'myst_parser', # enable markdown files |
46 | 48 | 'numpydoc', # this automatically loads `sphinx.ext.autosummary` as well |
47 | 49 | 'sphinx.ext.autodoc', # autodocument modules |
48 | 50 | 'sphinx.ext.autosectionlabel', |
| 51 | + 'sphinx.ext.intersphinx', # link to other projects' documentation |
49 | 52 | 'sphinx.ext.todo', # enable to-do sections |
50 | 53 | 'sphinx.ext.viewcode' # add links to view source code |
51 | 54 | ] |
|
59 | 62 | exclude_patterns = ['toc.rst'] |
60 | 63 |
|
61 | 64 | # Extensions to include. |
62 | | -source_suffix = ['.rst', '.md'] |
| 65 | +source_suffix = { |
| 66 | + '.rst': 'restructuredtext', |
| 67 | + '.md': 'markdown', |
| 68 | +} |
63 | 69 |
|
64 | 70 |
|
65 | 71 | # -- Options for HTML output ------------------------------------------------- |
66 | 72 |
|
67 | 73 | # images |
68 | | -html_favicon = os.path.join(definitions.Paths().ROOT_DIR, 'web', 'images', 'retroarcher.ico') |
| 74 | +html_favicon = os.path.join(definitions.Paths().ROOT_DIR, 'web', 'images', 'favicon.ico') |
69 | 75 | html_logo = os.path.join(definitions.Paths().ROOT_DIR, 'web', 'images', 'logo-circle.png') |
70 | 76 |
|
71 | 77 | # Add any paths that contain custom static files (such as style sheets) here, |
|
102 | 108 | # disable epub mimetype warnings |
103 | 109 | # https://github.com/readthedocs/readthedocs.org/blob/eadf6ac6dc6abc760a91e1cb147cc3c5f37d1ea8/docs/conf.py#L235-L236 |
104 | 110 | suppress_warnings = ["epub.unknown_project_files"] |
| 111 | + |
| 112 | +python_version = f'{sys.version_info.major}.{sys.version_info.minor}' |
| 113 | + |
| 114 | +intersphinx_mapping = { |
| 115 | + 'python': ('https://docs.python.org/{}/'.format(python_version), None), |
| 116 | +} |
| 117 | + |
| 118 | +numpydoc_show_class_members = True |
| 119 | +numpydoc_show_inherited_class_members = False |
| 120 | +numpydoc_xref_param_type = True |
0 commit comments