|
| 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 | +# Configuration file for the Sphinx documentation builder. |
| 10 | +"""Sphinx configuration file for Athena NodeJS SDK documentation.""" |
| 11 | + |
| 12 | +import sys |
| 13 | +from datetime import datetime, timezone |
| 14 | +from pathlib import Path |
| 15 | + |
| 16 | +# Add the project source directory to the Python path |
| 17 | +sys.path.insert(0, str(Path("../athena").resolve())) |
| 18 | + |
| 19 | +# Project information |
| 20 | +project = 'Athena Classifier NodeJS SDK' |
| 21 | +copyright = f"{datetime.now(timezone.utc).year}, Crisp" |
| 22 | +author = "Crisp" |
| 23 | +release = "1.0.0" |
| 24 | + |
| 25 | +js_language = 'typescript' |
| 26 | +js_source_path = '../src/' |
| 27 | +jsdoc_config_path = '../typedoc.json' |
| 28 | + |
| 29 | +# Extensions |
| 30 | +extensions = [ |
| 31 | + 'sphinx_js', |
| 32 | + "sphinx.ext.autodoc", |
| 33 | + "sphinx.ext.napoleon", |
| 34 | + "sphinx.ext.viewcode", |
| 35 | + "sphinx.ext.autosummary", |
| 36 | + "sphinx.ext.inheritance_diagram", |
| 37 | + "sphinx.ext.intersphinx", |
| 38 | + "sphinx.ext.todo", |
| 39 | + "myst_parser", |
| 40 | +] |
| 41 | + |
| 42 | +# Add any paths that contain templates here, relative to this directory |
| 43 | +templates_path = ["_templates"] |
| 44 | + |
| 45 | +# Template configuration |
| 46 | +autosummary_generate = True |
| 47 | +add_module_names = False |
| 48 | +autodoc_typehints = "description" |
| 49 | +autodoc_preserve_defaults = True |
| 50 | + |
| 51 | + |
| 52 | +# List of patterns to ignore when looking for source files |
| 53 | +exclude_patterns = [ |
| 54 | + "_build", |
| 55 | + "Thumbs.db", |
| 56 | + ".DS_Store", |
| 57 | + "**/generated/**", |
| 58 | + "**/tests/**", |
| 59 | + "**/__pycache__/**", |
| 60 | + "**/.pytest_cache/**", |
| 61 | + "**/.mypy_cache/**", |
| 62 | + "**/.ruff_cache/**", |
| 63 | +] |
| 64 | + |
| 65 | +# The theme to use for HTML and HTML Help pages |
| 66 | +html_theme = "furo" |
| 67 | + |
| 68 | +# Theme options |
| 69 | +html_theme_options = { |
| 70 | + "sidebar_hide_name": False, |
| 71 | + "navigation_with_keys": True, |
| 72 | + "source_repository": "https://github.com/crispthinking/athena-protobufs/", |
| 73 | + "source_branch": "main", |
| 74 | + "source_directory": "docs/", |
| 75 | + "light_css_variables": { |
| 76 | + "color-sidebar-background": "#f8f9fb", |
| 77 | + "color-brand-primary": "#20539E", |
| 78 | + "color-brand-content": "#20539E", |
| 79 | + "color-foreground-primary": "#4E585F", |
| 80 | + "color-background-primary": "#FEFEFE", |
| 81 | + "color-background-secondary": "#F7F7F7", |
| 82 | + "font-stack": ( |
| 83 | + "'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', " |
| 84 | + "Helvetica, Arial, sans-serif" |
| 85 | + ), |
| 86 | + }, |
| 87 | + "dark_css_variables": { |
| 88 | + "color-brand-primary": "#B6CBE9", |
| 89 | + "color-brand-content": "#B6CBE9", |
| 90 | + "color-foreground-primary": "#D5D5D5", |
| 91 | + "color-background-primary": "#393939", |
| 92 | + "color-background-secondary": "#434343", |
| 93 | + "color-sidebar-background": "#1E1E1E", |
| 94 | + "font-stack": ( |
| 95 | + "'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', " |
| 96 | + "Helvetica, Arial, sans-serif" |
| 97 | + ), |
| 98 | + }, |
| 99 | + "light_logo": "images/logo/Resolver_Lettermark_Main.png", |
| 100 | + "dark_logo": "images/logo/Resolver_Lettermark_White.png", |
| 101 | +} |
| 102 | + |
| 103 | +# HTML configuration |
| 104 | +html_static_path = ["_static"] |
| 105 | +html_favicon = "_static/images/favicon/favicon-32x32.png" |
| 106 | +html_css_files = ["css/custom.css"] |
| 107 | + |
| 108 | +# HTML context |
| 109 | +html_context = { |
| 110 | + "display_github": True, |
| 111 | + "github_user": "crispthinking", |
| 112 | + "github_repo": "athena-protobufs", |
| 113 | + "github_version": "main", |
| 114 | + "conf_py_path": "/docs/", |
| 115 | +} |
| 116 | + |
| 117 | +# Intersphinx configuration |
| 118 | +intersphinx_mapping = { |
| 119 | + "python": ("https://docs.python.org/3", None), |
| 120 | + "grpc": ("https://grpc.github.io/grpc/python/", None), |
| 121 | +} |
| 122 | + |
| 123 | +# Create required directories if they don't exist |
| 124 | +for path in ["_static", "_templates/autosummary"]: |
| 125 | + path_obj = Path(path) |
| 126 | + path_obj.mkdir(parents=True, exist_ok=True) |
| 127 | + |
| 128 | +# MyST parser configuration |
| 129 | +myst_enable_extensions = [ |
| 130 | + "deflist", |
| 131 | + "tasklist", |
| 132 | + "colon_fence", |
| 133 | +] |
| 134 | + |
| 135 | +# Napoleon settings |
| 136 | +napoleon_google_docstring = True |
| 137 | +napoleon_numpy_docstring = True |
| 138 | +napoleon_include_init_with_doc = True |
| 139 | +napoleon_include_private_with_doc = False |
| 140 | +napoleon_include_special_with_doc = True |
| 141 | +napoleon_use_admonition_for_examples = True |
| 142 | +napoleon_use_admonition_for_notes = True |
| 143 | +napoleon_use_admonition_for_references = True |
| 144 | +napoleon_use_ivar = False |
| 145 | +napoleon_use_param = True |
| 146 | +napoleon_use_rtype = True |
| 147 | +napoleon_type_aliases = None |
| 148 | + |
| 149 | +# AutoDoc settings |
| 150 | +autodoc_default_options = { |
| 151 | + "members": True, |
| 152 | + "member-order": "bysource", |
| 153 | + "special-members": "__init__", |
| 154 | + "undoc-members": True, |
| 155 | + "exclude-members": "__weakref__", |
| 156 | + "show-inheritance": True, |
| 157 | +} |
| 158 | + |
| 159 | +# Todo extension |
| 160 | +todo_include_todos = True |
| 161 | + |
| 162 | +# Output file name |
| 163 | +htmlhelp_basename = "AthenaProtobufsdoc" |
0 commit comments