|
| 1 | +# Configuration file for the Sphinx documentation builder. |
| 2 | +# |
| 3 | +# For the full list of built-in configuration values, see the documentation: |
| 4 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html |
| 5 | + |
| 6 | +# -- Project information ----------------------------------------------------- |
| 7 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information |
| 8 | + |
| 9 | +project = "weaviate-agents-python-client" |
| 10 | +copyright = "2025, Weaviate" |
| 11 | +author = "Weaviate" |
| 12 | + |
| 13 | +# -- General configuration --------------------------------------------------- |
| 14 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration |
| 15 | + |
| 16 | +# Add any Sphinx extension module names here, as strings. They can be |
| 17 | +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 18 | +# ones. |
| 19 | +extensions = [ |
| 20 | + "sphinx.ext.napoleon", |
| 21 | + "sphinx.ext.autodoc", |
| 22 | + "sphinx.ext.viewcode", |
| 23 | + "sphinx.ext.autosectionlabel", |
| 24 | + "sphinxcontrib.autodoc_pydantic", |
| 25 | +] |
| 26 | + |
| 27 | +# Autodoc settings for pydantic |
| 28 | +autodoc_pydantic_model_show_json = False |
| 29 | +autodoc_pydantic_model_show_config_summary = False |
| 30 | +autodoc_pydantic_model_show_validator_summary = False |
| 31 | +autodoc_pydantic_model_show_validator_members = False |
| 32 | +autodoc_pydantic_model_show_field_summary = False |
| 33 | +autodoc_pydantic_model_undoc_members = False |
| 34 | +autodoc_pydantic_model_members = False |
| 35 | + |
| 36 | +autodoc_typehints = "description" |
| 37 | +autodoc_member_order = "bysource" |
| 38 | +autodoc_dataclass_fields = False |
| 39 | + |
| 40 | +# Make sure the target is unique |
| 41 | +autosectionlabel_prefix_document = True |
| 42 | + |
| 43 | +autoclass_content = "both" |
| 44 | + |
| 45 | +# Add any paths that contain templates here, relative to this directory. |
| 46 | +templates_path = ["_templates"] |
| 47 | + |
| 48 | +# List of patterns, relative to source directory, that match files and |
| 49 | +# directories to ignore when looking for source files. |
| 50 | +# This pattern also affects html_static_path and html_extra_path. |
| 51 | +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "README.rst"] |
| 52 | + |
| 53 | +suppress_warnings = [ |
| 54 | + "docutils", |
| 55 | + "autodoc", |
| 56 | + "autosectionlabel", |
| 57 | +] |
| 58 | + |
| 59 | +# -- Options for HTML output ------------------------------------------------- |
| 60 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output |
| 61 | + |
| 62 | +html_theme = "sphinx_rtd_theme" |
| 63 | +html_static_path = ["_static"] |
| 64 | + |
| 65 | + |
| 66 | +import re |
| 67 | + |
| 68 | + |
| 69 | +def convert_markdown_links(lines): |
| 70 | + """Convert Markdown-style [text](url) links to reST-style `text <url>`_ links.""" |
| 71 | + md_link_pattern = re.compile(r"\[([^\]]+)\]\((http[^\)]+)\)") |
| 72 | + return [md_link_pattern.sub(r"`\1 <\2>`_", line) for line in lines] |
| 73 | + |
| 74 | + |
| 75 | +def autodoc_process_docstring(app, what, name, obj, options, lines): |
| 76 | + """Apply the conversion to all docstrings.""" |
| 77 | + lines[:] = convert_markdown_links(lines) |
| 78 | + |
| 79 | + |
| 80 | +def setup(app): |
| 81 | + app.add_css_file("custom.css") |
| 82 | + app.connect("autodoc-process-docstring", autodoc_process_docstring) |
0 commit comments