|
| 1 | +"""Configuration file for the Sphinx documentation builder.""" |
| 2 | + |
| 3 | +from datetime import datetime |
| 4 | +import os |
| 5 | + |
| 6 | +from ansys_sphinx_theme import ( |
| 7 | + ansys_favicon, |
| 8 | + ansys_logo_white, |
| 9 | + ansys_logo_white_cropped, |
| 10 | + get_version_match, |
| 11 | + watermark, |
| 12 | +) |
| 13 | + |
| 14 | +from ansys.tools.common import __version__ |
| 15 | + |
| 16 | +# Project information |
| 17 | +project = "ansys-tools-common" |
| 18 | +copyright = f"(c) {datetime.now().year} ANSYS, Inc. All rights reserved" |
| 19 | +author = "ANSYS, Inc." |
| 20 | +release = version = __version__ |
| 21 | +cname = os.getenv("DOCUMENTATION_CNAME", default="tools.docs.pyansys.com") |
| 22 | +switcher_version = get_version_match(__version__) |
| 23 | + |
| 24 | +html_theme = "ansys_sphinx_theme" |
| 25 | +html_short_title = html_title = "Ansys tools common" |
| 26 | +html_baseurl = f"https://{cname}/version/stable" |
| 27 | + |
| 28 | +# specify the location of your github repo |
| 29 | +html_context = { |
| 30 | + "github_user": "ansys", |
| 31 | + "github_repo": "ansys-tools-common", |
| 32 | + "github_version": "main", |
| 33 | + "doc_path": "doc/source", |
| 34 | +} |
| 35 | +html_theme_options = { |
| 36 | + "logo": "pyansys", |
| 37 | + "switcher": { |
| 38 | + "json_url": f"https://{cname}/versions.json", |
| 39 | + "version_match": switcher_version, |
| 40 | + }, |
| 41 | + "check_switcher": False, |
| 42 | + "github_url": "https://github.com/ansys/ansys-tools-common", |
| 43 | + "show_prev_next": False, |
| 44 | + "show_breadcrumbs": True, |
| 45 | + "collapse_navigation": True, |
| 46 | + "use_edit_page_button": True, |
| 47 | + "additional_breadcrumbs": [ |
| 48 | + ("PyAnsys", "https://docs.pyansys.com/"), |
| 49 | + ], |
| 50 | + "icon_links": [ |
| 51 | + { |
| 52 | + "name": "Support", |
| 53 | + "url": "https://github.com/ansys/ansys-tools-common/discussions", |
| 54 | + "icon": "fa fa-comment fa-fw", |
| 55 | + }, |
| 56 | + { |
| 57 | + "name": "Download documentation in PDF", |
| 58 | + "url": f"https://{cname}/version/{switcher_version}/_static/assets/download/ansys-tools-common.pdf", # noqa: E501 |
| 59 | + "icon": "fa fa-file-pdf fa-fw", |
| 60 | + }, |
| 61 | + ], |
| 62 | + "ansys_sphinx_theme_autoapi": { |
| 63 | + "project": project, |
| 64 | + "package_depth": 3, |
| 65 | + }, |
| 66 | + "static_search": { |
| 67 | + "threshold": 0.5, |
| 68 | + "minMatchCharLength": 2, |
| 69 | + "ignoreLocation": True, |
| 70 | + }, |
| 71 | +} |
| 72 | + |
| 73 | +# Sphinx extensions |
| 74 | +extensions = [ |
| 75 | + "sphinx.ext.intersphinx", |
| 76 | + "sphinx_copybutton", |
| 77 | + "sphinx_design", |
| 78 | + "ansys_sphinx_theme.extension.autoapi", |
| 79 | +] |
| 80 | + |
| 81 | +# numpydoc configuration |
| 82 | +numpydoc_show_class_members = False |
| 83 | +numpydoc_xref_param_type = True |
| 84 | + |
| 85 | +# Consider enabling numpydoc validation. See: |
| 86 | +# https://numpydoc.readthedocs.io/en/latest/validation.html# |
| 87 | +numpydoc_validate = True |
| 88 | +numpydoc_validation_checks = { |
| 89 | + "GL06", # Found unknown section |
| 90 | + "GL07", # Sections are in the wrong order. |
| 91 | + # "GL08", # The object does not have a docstring |
| 92 | + "GL09", # Deprecation warning should precede extended summary |
| 93 | + "GL10", # reST directives {directives} must be followed by two colons |
| 94 | + "SS01", # No summary found |
| 95 | + "SS02", # Summary does not start with a capital letter |
| 96 | + # "SS03", # Summary does not end with a period |
| 97 | + "SS04", # Summary contains heading whitespaces |
| 98 | + # "SS05", # Summary must start with infinitive verb, not third person |
| 99 | + "RT02", # The first line of the Returns section should contain only the |
| 100 | + # type, unless multiple values are being returned" |
| 101 | +} |
| 102 | + |
| 103 | +html_favicon = ansys_favicon |
| 104 | +# Add any paths that contain templates here, relative to this directory. |
| 105 | +templates_path = ["_templates"] |
| 106 | + |
| 107 | +# The suffix(es) of source filenames. |
| 108 | +source_suffix = { |
| 109 | + ".rst": "restructuredtext", |
| 110 | + ".md": "markdown", |
| 111 | +} |
| 112 | + |
| 113 | +typehints_defaults = "comma" |
| 114 | +# additional logos for the latex coverpage |
| 115 | +latex_additional_files = [watermark, ansys_logo_white, ansys_logo_white_cropped] |
0 commit comments