From f957a5e9de230321229089b543767ffbf6fc3669 Mon Sep 17 00:00:00 2001 From: engrosamaali91 Date: Wed, 26 Jul 2023 15:15:33 +0200 Subject: [PATCH] conf.py file updated --- doc/conf.py | 102 +++++++++++++++++++--------------------------------- 1 file changed, 37 insertions(+), 65 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 95886f8..0f88a6d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -16,13 +16,12 @@ import brainprint -project = "Brainprint" +project = "brainprint" author = "Martin Reuter" copyright = f"{date.today().year}, {author}" release = brainprint.__version__ package = brainprint.__name__ gh_url = "https://github.com/Deep-MI/BrainPrint" - # -- general configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration @@ -39,17 +38,36 @@ "sphinx.ext.autosummary", "sphinx.ext.intersphinx", "sphinx.ext.linkcode", - "sphinxcontrib.napoleon", + # "sphinxcontrib.napoleon", "sphinxcontrib.bibtex", "sphinx_copybutton", "sphinx_design", - "sphinx_gallery.gen_gallery", + # "sphinx_gallery.gen_gallery", "IPython.sphinxext.ipython_console_highlighting", "numpydoc", # "sphinx.ext.todo", # "sphinx.ext.viewcode", + # "myst_parser", ] + +# myst_enable_extensions = [ +# "amsmath", +# "attrs_inline", +# "colon_fence", +# "deflist", +# "dollarmath", +# "fieldlist", +# "html_admonition", +# "html_image", +# "linkify", +# "replacements", +# "smartquotes", +# "strikethrough", +# "substitution", +# "tasklist", +# ] +# myst_heading_anchors = 2 # numpydoc_class_members_toctree = True @@ -131,53 +149,7 @@ bibtex_bibfiles = ["./references.bib"] -# -- sphinx.ext.linkcode ----------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/extensions/linkcode.html - - - -# def linkcode_resolve(domain: str, info: Dict[str, str]) -> Optional[str]: -# """Determine the URL corresponding to a Python object. - -# Parameters -# ---------- -# domain : str -# One of 'py', 'c', 'cpp', 'javascript'. -# info : dict -# With keys "module" and "fullname". - -# Returns -# ------- -# url : str | None -# The code URL. If None, no link is added. -# """ -# if domain != "py": -# return None # only document python objects - -# # retrieve pyobject and file -# try: -# module = import_module(info["module"]) -# pyobject = module -# for elt in info["fullname"].split("."): -# pyobject = getattr(pyobject, elt) -# fname = inspect.getsourcefile(pyobject).replace("\\", "/") -# except Exception: -# # Either the object could not be loaded or the file was not found. -# # For instance, properties will raise. -# return None - -# # retrieve start/stop lines -# source, start_line = inspect.getsourcelines(pyobject) -# lines = "L%d-L%d" % (start_line, start_line + len(source) - 1) - -# # create URL -# if "dev" in release: -# branch = "main" -# else: -# return None # alternatively, link to a maint/version branch -# fname = fname.rsplit(f"/{package}/")[1] -# url = f"{gh_url}/blob/{branch}/{package}/{fname}#{lines}" -# return url + # using this method to link github source code as the above method was working with # brain print project @@ -231,20 +203,20 @@ def linkcode_resolve(domain, info): # In examples_dirs extension I replaced ../examples with generated/examples # because it was not able to recognize examples path with knowing the parent folder i.e generated # -- sphinx-gallery ---------------------------------------------------------- -sphinx_gallery_conf = { - "backreferences_dir": "generated/backreferences", - "doc_module": (f"{package}",), - "examples_dirs": ["generated/examples"], - "exclude_implicit_doc": {}, # set - "filename_pattern": r"\d{2}_", - "gallery_dirs": ["generated/examples"], - "line_numbers": False, - "plot_gallery": True, - "reference_url": {f"{package}": None}, - "remove_config_comments": True, - "show_memory": True, - "within_subsection_order": FileNameSortKey, -} +# sphinx_gallery_conf = { +# "backreferences_dir": "generated/backreferences", +# "doc_module": (f"{package}",), +# "examples_dirs": ["generated/examples"], +# "exclude_implicit_doc": {}, # set +# "filename_pattern": r"\d{2}_", +# "gallery_dirs": ["generated/examples"], +# "line_numbers": False, +# "plot_gallery": True, +# "reference_url": {f"{package}": None}, +# "remove_config_comments": True, +# "show_memory": True, +# "within_subsection_order": FileNameSortKey, +# } import os