|
7 | 7 | # -- Path setup -------------------------------------------------------------- |
8 | 8 |
|
9 | 9 | # If extensions (or modules to document with autodoc) are in another directory, |
10 | | -# add these directories to sys.path here. If the directory is relative to the |
11 | | -# documentation root, use os.path.abspath to make it absolute, like shown here. |
12 | | -# |
13 | | -# import os |
14 | | -# import sys |
15 | | -# sys.path.insert(0, os.path.abspath('.')) |
| 10 | +# add these directories to sys.path here. |
| 11 | + |
| 12 | +import pathlib |
| 13 | +import sys |
16 | 14 |
|
| 15 | +srcdir = pathlib.Path(__file__).resolve().parents[2].joinpath('src') |
| 16 | +sys.path.insert(0, srcdir.as_posix()) |
17 | 17 |
|
18 | 18 | # -- Project information ----------------------------------------------------- |
19 | 19 |
|
|
28 | 28 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
29 | 29 | # ones. |
30 | 30 | extensions = [ |
| 31 | + "sphinx.ext.autodoc", |
31 | 32 | "sphinx.ext.intersphinx", |
| 33 | + "sphinxcontrib.apidoc", |
32 | 34 | ] |
33 | 35 |
|
34 | | -# This points to aboutcode.readthedocs.io |
35 | | -# In case of "undefined label" ERRORS check docs on intersphinx to troubleshoot |
36 | | -# Link was created at commit - https://github.com/nexB/aboutcode/commit/faea9fcf3248f8f198844fe34d43833224ac4a83 |
| 36 | +# FIXME: including AND, NOT and OR will result in endless recursion |
| 37 | +autodoc_default_options = { |
| 38 | + 'exclude-members': 'AND, NOT, OR', |
| 39 | +} |
37 | 40 |
|
| 41 | +# Setting for sphinxcontrib.apidoc to automatically create API documentation. |
| 42 | +apidoc_module_dir = srcdir.joinpath('license_expression').as_posix() |
| 43 | + |
| 44 | +# Reference to other Sphinx documentations |
38 | 45 | intersphinx_mapping = { |
39 | | - "aboutcode": ("https://aboutcode.readthedocs.io/en/latest/", None), |
40 | | - "scancode-workbench": ("https://scancode-workbench.readthedocs.io/en/develop/", None), |
| 46 | + "python": ("https://docs.python.org/3", None), |
| 47 | + "boolean.py": ("https://booleanpy.readthedocs.io/en/latest/", None), |
41 | 48 | } |
42 | 49 |
|
43 | | - |
44 | 50 | # Add any paths that contain templates here, relative to this directory. |
45 | 51 | templates_path = ["_templates"] |
46 | 52 |
|
|
0 commit comments