|
4 | 4 | documentation: https://www.sphinx-doc.org/en/master/usage/configuration.html
|
5 | 5 |
|
6 | 6 | """
|
| 7 | +from importlib.metadata import version |
| 8 | + |
| 9 | + |
7 | 10 | # -- Project information -----------------------------------------------------
|
8 | 11 |
|
9 | 12 |
|
|
12 | 15 | copyright = f"2021, {author}" # noqa: A001
|
13 | 16 |
|
14 | 17 | # The version, including alpha/beta/rc tags, but not commit hash and datestamps
|
15 |
| -release = "1.1.0" |
| 18 | +release = version("cookiecutter-pytask-project") |
16 | 19 | # The short X.Y version.
|
17 |
| -version = "1.1" |
| 20 | +version = ".".join(release.split(".")[:2]) |
18 | 21 |
|
19 | 22 |
|
20 | 23 | # -- General configuration ---------------------------------------------------
|
21 | 24 |
|
22 | 25 | # Add any Sphinx extension module names here, as strings. They can be extensions coming
|
23 | 26 | # with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
24 |
| -extensions = [] |
| 27 | +extensions = [ |
| 28 | + "IPython.sphinxext.ipython_console_highlighting", |
| 29 | + "IPython.sphinxext.ipython_directive", |
| 30 | + "sphinx.ext.autodoc", |
| 31 | + "sphinx.ext.autosummary", |
| 32 | + "sphinx.ext.extlinks", |
| 33 | + "sphinx.ext.intersphinx", |
| 34 | + "sphinx.ext.napoleon", |
| 35 | + "sphinx.ext.viewcode", |
| 36 | + "sphinx_copybutton", |
| 37 | + "sphinx_panels", |
| 38 | + "autoapi.extension", |
| 39 | +] |
25 | 40 |
|
26 | 41 | # Add any paths that contain templates here, relative to this directory.
|
27 | 42 | templates_path = ["_templates"]
|
28 | 43 |
|
29 | 44 | # List of patterns, relative to source directory, that match files and directories to
|
30 | 45 | # ignore when looking for source files. This pattern also affects html_static_path and
|
31 | 46 | # html_extra_path.
|
32 |
| -exclude_patterns = [] |
| 47 | +exclude_patterns = ["build", "Thumbs.db", ".DS_Store", "**.ipynb_checkpoints"] |
| 48 | + |
| 49 | +# Configuration for autoapi to generate and API page. |
| 50 | +autoapi_type = "python" |
| 51 | +autoapi_dirs = ["../../hooks"] |
| 52 | +autoapi_keep_files = False |
| 53 | +autoapi_add_toctree_entry = False |
| 54 | + |
| 55 | +# Remove prefixed $ for bash, >>> for Python prompts, and In [1]: for IPython prompts. |
| 56 | +copybutton_prompt_text = r"\$ |>>> |In \[\d\]: " |
| 57 | +copybutton_prompt_is_regexp = True |
| 58 | + |
| 59 | +# Use these roles to create links to github users and pull requests. |
| 60 | +extlinks = { |
| 61 | + "ghuser": ("https://github.com/%s", "@"), |
| 62 | + "gh": ("https://github.com/pytask-dev/cookiecutter-pytask-project/pull/%s", "#"), |
| 63 | +} |
| 64 | + |
| 65 | +# Link objects to other documentations. |
| 66 | +intersphinx_mapping = { |
| 67 | + "python": ("https://docs.python.org/3.9", None), |
| 68 | + "pytask": ("https://pytask-dev.readthedocs.io/en/stable/", None), |
| 69 | +} |
33 | 70 |
|
34 | 71 |
|
35 | 72 | # -- Options for HTML output -------------------------------------------------
|
|
38 | 75 | # builtin themes.
|
39 | 76 | html_theme = "furo"
|
40 | 77 |
|
| 78 | +pygments_style = "sphinx" |
| 79 | +pygments_dark_style = "monokai" |
| 80 | + |
41 | 81 | # Add any paths that contain custom static files (such as style sheets) here, relative
|
42 | 82 | # to this directory. They are copied after the builtin static files, so a file named
|
43 | 83 | # "default.css" will overwrite the builtin "default.css".
|
|
0 commit comments