Skip to content

Commit

Permalink
conf.py file updated
Browse files Browse the repository at this point in the history
  • Loading branch information
engrosamaali91 committed Jul 26, 2023
1 parent f0122ea commit f957a5e
Showing 1 changed file with 37 additions and 65 deletions.
102 changes: 37 additions & 65 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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


Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f957a5e

Please sign in to comment.