|
| 1 | +# Configuration file for the Sphinx documentation builder. |
| 2 | +# |
| 3 | +# This file only contains a selection of the most common options. For a full |
| 4 | +# list see the documentation: |
| 5 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html |
| 6 | + |
| 7 | +# -- Path setup -------------------------------------------------------------- |
| 8 | + |
| 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 | +from pathlib import Path |
| 15 | +import sys |
| 16 | + |
| 17 | + |
| 18 | +def get_script_dir() -> Path: |
| 19 | + """Return path to the script directory.""" |
| 20 | + return Path(__file__).resolve().parent |
| 21 | + |
| 22 | + |
| 23 | +src_dir = get_script_dir() / ".." / ".." / "src" |
| 24 | +src_dir = src_dir.resolve() |
| 25 | +assert(src_dir.is_dir()) |
| 26 | + |
| 27 | +sys.path.insert(0, str(src_dir)) |
| 28 | + |
| 29 | + |
| 30 | +# -- Project information ----------------------------------------------------- |
| 31 | + |
| 32 | +project = 'PyOpenocdClient' |
| 33 | +copyright = '2024, Jan Matyáš' |
| 34 | +author = 'Jan Matyáš' |
| 35 | + |
| 36 | + |
| 37 | +# -- General configuration --------------------------------------------------- |
| 38 | + |
| 39 | +# Add any Sphinx extension module names here, as strings. They can be |
| 40 | +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 41 | +# ones. |
| 42 | +extensions = [ |
| 43 | + 'sphinx.ext.autodoc', |
| 44 | + 'sphinx.ext.doctest', |
| 45 | + 'sphinx.ext.intersphinx', |
| 46 | + 'sphinx_design', |
| 47 | + 'enum_tools.autoenum', |
| 48 | +] |
| 49 | + |
| 50 | +# Add any paths that contain templates here, relative to this directory. |
| 51 | +templates_path = ['_templates'] |
| 52 | + |
| 53 | +# List of patterns, relative to source directory, that match files and |
| 54 | +# directories to ignore when looking for source files. |
| 55 | +# This pattern also affects html_static_path and html_extra_path. |
| 56 | +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] |
| 57 | + |
| 58 | +# Keep the order of methods as in the source code |
| 59 | +autodoc_member_order = 'bysource' |
| 60 | + |
| 61 | +# -- Options for HTML output ------------------------------------------------- |
| 62 | + |
| 63 | +# The theme to use for HTML and HTML Help pages. See the documentation for |
| 64 | +# a list of builtin themes. |
| 65 | +# |
| 66 | +html_theme = 'sphinx_rtd_theme' |
| 67 | + |
| 68 | +html_theme_options = { |
| 69 | + "navigation_depth": 3 |
| 70 | +} |
| 71 | + |
| 72 | +# Add any paths that contain custom static files (such as style sheets) here, |
| 73 | +# relative to this directory. They are copied after the builtin static files, |
| 74 | +# so a file named "default.css" will overwrite the builtin "default.css". |
| 75 | +#html_static_path = ['_static'] |
| 76 | + |
| 77 | +# Set up intersphinx maps |
| 78 | +intersphinx_mapping = {'numpy': ('https://numpy.org/doc/stable', None)} |
0 commit comments