|
| 1 | +"""Configure Sphinx documentation.""" |
| 2 | +# pylint: disable=invalid-name |
| 3 | +import sys |
| 4 | + |
| 5 | +import generative_ai |
| 6 | + |
| 7 | +sys.path.insert(0, "../src") |
| 8 | + |
| 9 | +project = "query-package-documentation" |
| 10 | +version = str(generative_ai.__version__) |
| 11 | +project_copyright = "2024, Anirban Ray" |
| 12 | +author = "Anirban Ray" |
| 13 | +release = f"v{version}" |
| 14 | + |
| 15 | +extensions = [ |
| 16 | + "myst_parser", |
| 17 | + "sphinx.ext.autodoc", |
| 18 | + "sphinx.ext.intersphinx", |
| 19 | + "sphinx.ext.napoleon", |
| 20 | + "sphinx_copybutton", |
| 21 | +] |
| 22 | +source_suffix = {".md": "markdown", ".rst": "restructuredtext"} |
| 23 | + |
| 24 | +smartquotes = False |
| 25 | +today_fmt = "%Y-%m-%d" |
| 26 | +highlight_language = "python3" |
| 27 | +pygments_style = "friendly" |
| 28 | +add_function_parentheses = False |
| 29 | +add_module_names = False |
| 30 | +option_emphasise_placeholders = True |
| 31 | + |
| 32 | +html_theme = "furo" |
| 33 | +html_theme_options = {"top_of_page_button": None} |
| 34 | +html_title = f"{project} {release}" |
| 35 | + |
| 36 | +html_last_updated_fmt = "%B %d, %Y" |
| 37 | +html_use_index = True |
| 38 | +html_split_index = False |
| 39 | +html_copy_source = False |
| 40 | +html_show_sourcelink = False |
| 41 | +html_show_sphinx = False |
| 42 | +html_output_encoding = "utf-8" |
| 43 | + |
| 44 | +python_display_short_literal_types = True |
| 45 | + |
| 46 | +myst_enable_extensions = [ |
| 47 | + "amsmath", |
| 48 | + "attrs_inline", |
| 49 | + "colon_fence", |
| 50 | + "deflist", |
| 51 | + "dollarmath", |
| 52 | + "fieldlist", |
| 53 | + "html_admonition", |
| 54 | + "html_image", |
| 55 | + "linkify", |
| 56 | + "replacements", |
| 57 | + "smartquotes", |
| 58 | + "strikethrough", |
| 59 | + "substitution", |
| 60 | + "tasklist", |
| 61 | +] |
| 62 | + |
| 63 | +autoclass_content = "class" |
| 64 | +autodoc_inherit_docstrings = True |
| 65 | +autodoc_member_order = "bysource" |
| 66 | +autodoc_typehints = "both" |
| 67 | +autodoc_typehints_description_target = "documented" |
| 68 | +autodoc_typehints_format = "short" |
| 69 | + |
| 70 | +intersphinx_mapping = { |
| 71 | + "python": ("https://docs.python.org/3", None), |
| 72 | + "langchain": ("https://api.python.langchain.com/en/stable", None), |
| 73 | + "numpydoc": ("https://numpydoc.readthedocs.io/en/stable", None), |
| 74 | +} |
| 75 | + |
| 76 | +napoleon_google_docstring = False |
| 77 | +napoleon_numpy_docstring = True |
| 78 | +napoleon_include_init_with_doc = False |
| 79 | +napoleon_use_param = True |
| 80 | +napoleon_use_keyword = True |
| 81 | +napoleon_use_rtype = True |
| 82 | +napoleon_preprocess_types = True |
| 83 | + |
| 84 | +copybutton_prompt_text = r">>> |\.\.\. |\$ " |
| 85 | +copybutton_prompt_is_regexp = True |
| 86 | +copybutton_line_continuation_character = "\\" |
0 commit comments