diff options
Diffstat (limited to 'doc/source/conf.py')
-rw-r--r-- | doc/source/conf.py | 110 |
1 files changed, 74 insertions, 36 deletions
diff --git a/doc/source/conf.py b/doc/source/conf.py index 2d242e9..b412a1d 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -1,5 +1,5 @@ # /*########################################################################## -# Copyright (C) 2015-2022 European Synchrotron Radiation Facility +# Copyright (C) 2015-2023 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -39,7 +39,7 @@ import sys # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # sys.path.insert(0, os.path.abspath('.')) -project = u'silx' +project = "silx" import silx # Disable deprecation warnings: @@ -47,10 +47,11 @@ import silx # If we want to generate the documentation of deprecated features it should # not make the logs durty. from silx.utils.deprecation import depreclog + depreclog.disabled = 1 # Add local sphinx extension directory -sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'ext')) +sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "ext")) # -- General configuration ----------------------------------------------------- @@ -60,40 +61,45 @@ sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'ext')) # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.coverage', - 'sphinx.ext.mathjax', - 'sphinx.ext.viewcode', - 'sphinx.ext.doctest', - 'sphinx.ext.inheritance_diagram', - 'sphinxext-archive', - 'snapshotqt_directive', - 'nbsphinx' + "sphinx.ext.autodoc", + "sphinx.ext.coverage", + "sphinx.ext.mathjax", + "sphinx.ext.viewcode", + "sphinx.ext.doctest", + "sphinx.ext.inheritance_diagram", + "sphinx_panels", + "sphinxext-archive", + "snapshotqt_directive", + "nbsphinx", ] -if importlib.util.find_spec('sphinx_autodoc_typehints'): - extensions.append('sphinx_autodoc_typehints') +if importlib.util.find_spec("sphinx_autodoc_typehints"): + extensions.append("sphinx_autodoc_typehints") always_document_param_types = True -autodoc_member_order = 'bysource' +autodoc_member_order = "bysource" # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # The suffix of source filenames. -source_suffix = '.rst' +source_suffix = ".rst" # The encoding of source files. # source_encoding = 'utf-8-sig' # The master toctree document. -master_doc = 'index' +master_doc = "index" # General information about the project. from silx._version import strictversion, version, __date__ as _date + year = _date.split("/")[-1] -copyright = u'2015-%s, Data analysis unit, European Synchrotron Radiation Facility, Grenoble' % year +copyright = ( + "2015-%s, Data analysis unit, European Synchrotron Radiation Facility, Grenoble" + % year +) # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -104,6 +110,16 @@ copyright = u'2015-%s, Data analysis unit, European Synchrotron Radiation Facili # The full version, including alpha/beta/rc tags. release = strictversion +# Substitutions defined for all pages +rst_prolog = f""" +.. |silx_installer_btn| replace:: + .. link-button:: https://github.com/silx-kit/silx/releases/download/v{release}/silx-{release}-windows-installer-x86_64.exe + :classes: btn-success + :text: Download Windows installer + +.. |silx_archive| replace:: :download:`silx ZIP archive <https://github.com/silx-kit/silx/releases/download/v{release}/silx-{release}-windows-application.zip>` +""" + # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # language = None @@ -133,7 +149,7 @@ add_module_names = False # show_authors = False # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = "sphinx" # A list of ignored prefixes for module index sorting. # modindex_common_prefix = [] @@ -143,12 +159,33 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' +html_theme = "pydata_sphinx_theme" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -# html_theme_options = {} +html_theme_options = { + "icon_links": [ + { + "name": "GitHub", + "url": "https://github.com/silx-kit/silx", + "icon": "fa-brands fa-github", + }, + { + "name": "PyPI", + "url": "https://pypi.org/project/silx", + "icon": "_static/navbar_icons/pypi.svg", + "type": "local", + }, + ], + "show_toc_level": 1, + "navbar_align": "left", + "show_version_warning_banner": True, + "navbar_start": ["navbar-logo", "version"], + "navbar_center": ["navbar-nav"], + "footer_start": ["copyright"], + "footer_center": ["sphinx-version"], +} # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] @@ -172,7 +209,7 @@ html_favicon = "img/silx.ico" # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -# html_static_path = [] +html_static_path = ["_static"] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. @@ -216,19 +253,17 @@ html_favicon = "img/silx.ico" # html_file_suffix = None # Output file base name for HTML help builder. -htmlhelp_basename = 'silxdoc' +htmlhelp_basename = "silxdoc" # -- Options for LaTeX output -------------------------------------------------- -latex_elements = {'papersize': 'a4paper', - 'pointsize': '10pt'} +latex_elements = {"papersize": "a4paper", "pointsize": "10pt"} # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'silx.tex', u'silx Documentation', - u'Data analysis unit', 'manual'), + ("index", "silx.tex", "silx Documentation", "Data analysis unit", "manual"), ] # The name of an image file (relative to this directory) to place at the top of @@ -256,10 +291,7 @@ latex_logo = "img/silx_large.png" # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [ - ('index', 'silx', u'silx Documentation', - [u'Data analysis unit'], 1) -] +man_pages = [("index", "silx", "silx Documentation", ["Data analysis unit"], 1)] # If true, show URL addresses after external links. # man_show_urls = False @@ -271,9 +303,15 @@ man_pages = [ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'silx', u'silx Documentation', - u'Data analysis unit', 'silx', 'One line description of project.', - 'Miscellaneous'), + ( + "index", + "silx", + "silx Documentation", + "Data analysis unit", + "silx", + "One line description of project.", + "Miscellaneous", + ), ] # Documents to append as an appendix to all manuals. @@ -286,4 +324,4 @@ texinfo_documents = [ # texinfo_show_urls = 'footnote' # Do not test code in >>> by default -doctest_test_doctest_blocks = '' +doctest_test_doctest_blocks = "" |