|
9 | 9 | import os |
10 | 10 | import sys |
11 | 11 |
|
12 | | -sys.path.insert(0, os.path.abspath("../../dialogue2graph")) |
| 12 | +sys.path.insert(0, os.path.abspath("../../dialog2graph")) |
13 | 13 |
|
14 | | -project = "Dialogue2Graph" |
15 | | -copyright = "2024, Denis Kuznetsov, Anastasia Voznyuk, Andrey Chirkin" |
16 | | -author = "Denis Kuznetsov, Anastasia Voznyuk, Andrey Chirkin" |
| 14 | +project = "Dialog2Graph" |
| 15 | +copyright = "2025, Denis Kuznetsov, Anastasia Voznyuk, Andrey Chirkin, Anna Mikhailova, Maria Molchanova, Yuri Peshkichev" |
| 16 | +author = "Denis Kuznetsov, Anastasia Voznyuk, Andrey Chirkin, Anna Mikhailova, Maria Molchanova, Yuri Peshkichev" |
17 | 17 |
|
18 | 18 | # Get the deployment environment |
19 | 19 | on_github = os.environ.get("GITHUB_ACTIONS") == "true" |
20 | 20 |
|
21 | 21 | # Configure URLs for GitHub Pages |
22 | 22 | if on_github: |
23 | | - html_baseurl = "/dialogue2graph/dev/" |
| 23 | + html_baseurl = "/dialog2graph/dev/" |
24 | 24 | html_context = { |
25 | 25 | "display_github": True, |
26 | 26 | "github_user": "deeppavlov", |
27 | | - "github_repo": "dialogue2graph", |
| 27 | + "github_repo": "dialog2graph", |
28 | 28 | "github_version": "dev", |
29 | 29 | "conf_py_path": "/docs/source/", |
30 | 30 | } |
|
34 | 34 |
|
35 | 35 | extensions = [ |
36 | 36 | "sphinx.ext.autodoc", |
| 37 | + "sphinx.ext.autosummary", |
| 38 | + "sphinx.ext.doctest", |
| 39 | + "autoapi.extension", |
| 40 | + "sphinx.ext.intersphinx", |
| 41 | + "sphinx.ext.todo", |
| 42 | + "sphinx.ext.coverage", |
37 | 43 | "sphinx.ext.viewcode", |
38 | 44 | "sphinx.ext.napoleon", |
39 | 45 | "sphinx.ext.extlinks", |
40 | 46 | "sphinx_autodoc_typehints", |
41 | | - "sphinxcontrib.apidoc", |
| 47 | + "sphinx.ext.graphviz", |
42 | 48 | ] |
43 | 49 |
|
44 | | -templates_path = ["_templates"] |
45 | | - |
46 | 50 | autodoc_default_options = { |
47 | 51 | "members": True, |
48 | 52 | "undoc-members": False, |
49 | | - "private-members": False, |
| 53 | + "private-members": True, |
50 | 54 | "special-members": "__call__", |
51 | 55 | "member-order": "bysource", |
52 | 56 | "exclude-members": "_abc_impl, model_fields, model_computed_fields, model_config", |
53 | 57 | } |
54 | 58 |
|
55 | | -# Mock imports that cause issues |
56 | | -autodoc_mock_imports = ["datasets"] |
57 | | - |
58 | | -apidoc_module_dir = "../../dialogue2graph" |
59 | | -apidoc_output_dir = "reference" |
| 59 | +autodoc_typehints = "both" |
60 | 60 |
|
| 61 | +autoapi_dirs = ["../../dialog2graph"] |
| 62 | +autoapi_options = [ |
| 63 | + "members", |
| 64 | + "undoc-members", |
| 65 | + "show-inheritance", |
| 66 | + "show-module-summary", |
| 67 | + "special-members", |
| 68 | + "imported-members", |
| 69 | +] |
| 70 | +suppress_warnings = ["autoapi.python_import_resolution"] |
| 71 | +autoapi_ignore = ["*/cli/*.py"] |
| 72 | + |
| 73 | +napoleon_google_docstring = True |
| 74 | +napoleon_include_init_with_doc = False |
| 75 | +napoleon_include_private_with_doc = False |
| 76 | +napoleon_include_special_with_doc = True |
| 77 | +napoleon_use_admonition_for_examples = False |
| 78 | +napoleon_use_admonition_for_notes = False |
| 79 | +napoleon_use_admonition_for_references = False |
| 80 | +napoleon_use_ivar = False |
| 81 | +napoleon_use_param = True |
| 82 | +napoleon_use_rtype = True |
| 83 | +napoleon_preprocess_types = False |
| 84 | +napoleon_type_aliases = None |
| 85 | +napoleon_attr_annotations = True |
61 | 86 |
|
62 | 87 | # -- Options for HTML output ------------------------------------------------- |
63 | 88 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output |
64 | 89 |
|
65 | 90 | # html_theme = 'alabaster' |
66 | 91 | html_theme = "pydata_sphinx_theme" |
67 | 92 |
|
| 93 | +# Add any paths that contain templates here, relative to this directory. |
| 94 | +templates_path = ["_templates"] |
| 95 | + |
68 | 96 | # Add any paths that contain custom static files (such as style sheets) here, |
69 | 97 | # relative to this directory. They are copied after the builtin static files, |
70 | 98 | # so a file named "default.css" will overwrite the builtin "default.css". |
71 | 99 | html_static_path = ["_static"] |
72 | 100 |
|
| 101 | +html_show_sourcelink = False |
| 102 | + |
73 | 103 | extlinks = { |
74 | 104 | "github_source_link": ( |
75 | | - "https://github.com/deeppavlov/dialogue2graph/tree/dev/%s", |
| 105 | + "https://github.com/deeppavlov/dialog2graph/tree/dev/%s", |
76 | 106 | None, |
77 | 107 | ), |
78 | 108 | } |
|
83 | 113 | "scripts/bootstrap.js", |
84 | 114 | "scripts/fontawesome.js", |
85 | 115 | ] |
| 116 | +html_css_files = [ |
| 117 | + "css/custom.css", |
| 118 | +] |
86 | 119 |
|
87 | 120 | # Fix base URL for GitHub Pages |
88 | | -html_baseurl = "/dialogue2graph/dev/" |
| 121 | +html_baseurl = "/dialog2graph/dev/" |
89 | 122 |
|
90 | 123 | # Important: Add this to handle static files correctly |
91 | 124 | html_theme_options = { |
| 125 | + "header_links_before_dropdown": 6, |
92 | 126 | "use_edit_page_button": False, |
93 | 127 | "navigation_depth": 3, |
94 | 128 | "show_toc_level": 2, |
95 | 129 | # Add this to fix static file paths |
96 | | - "static_page_path": "/dialogue2graph/dev/_static/", |
| 130 | + "static_page_path": "/dialog2graph/dev/_static/", |
| 131 | + "icon_links": [ |
| 132 | + { |
| 133 | + "name": "GitHub", |
| 134 | + "url": "https://github.com/deeppavlov/dialog2graph", |
| 135 | + "icon": "fa-brands fa-github", |
| 136 | + "type": "fontawesome", |
| 137 | + }, |
| 138 | + ], |
| 139 | + "secondary_sidebar_items": ["example-links", "page-toc"], |
97 | 140 | } |
98 | 141 |
|
99 | 142 | # Fix relative URLs for GitHub Pages deployment |
100 | 143 | html_use_relative_paths = True |
101 | 144 |
|
102 | 145 | # Ensure all static paths are properly prefixed for GitHub Pages |
103 | 146 | if os.environ.get("GITHUB_ACTIONS") == "true": |
104 | | - html_static_path_suffix = "/dialogue2graph/dev" |
| 147 | + html_static_path_suffix = "/dialog2graph/dev" |
| 148 | + |
| 149 | + |
| 150 | +def skip_submodules(app, what, name, obj, skip, options): |
| 151 | + if what == "module" and "." not in name: |
| 152 | + skip = True |
| 153 | + return skip |
| 154 | + |
| 155 | + |
| 156 | +def setup(sphinx): |
| 157 | + sphinx.connect("autoapi-skip-member", skip_submodules) |
0 commit comments