Skip to content

Commit

Permalink
Update conf.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ASEM000 committed Jul 20, 2023
1 parent 3ae833d commit 6cf62b0
Showing 1 changed file with 1 addition and 41 deletions.
42 changes: 1 addition & 41 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

sys.path.insert(0, os.path.abspath(".."))

import pytreeclass
import serket
import sphinxcontrib.katex as katex

# -- Project information -----------------------------------------------------
Expand Down Expand Up @@ -126,46 +126,6 @@
# Add LaTeX macros for LATEX builder
latex_elements = {"preamble": latex_macros}


# -- Source code links -------------------------------------------------------


def linkcode_resolve(domain, info):
"""Resolve a GitHub URL corresponding to Python object."""
if domain != "py":
return None

try:
mod = sys.modules[info["module"]]
except ImportError:
return None

obj = mod
try:
for attr in info["fullname"].split("."):
obj = getattr(obj, attr)
except AttributeError:
return None
else:
obj = inspect.unwrap(obj)

try:
filename = inspect.getsourcefile(obj)
except TypeError:
return None

try:
source, lineno = inspect.getsourcelines(obj)
except OSError:
return None

return "https://github.com/ASEM000/pytreeclass/blob/main/pytreeclass/%s#L%d#L%d" % (
os.path.relpath(filename, start=os.path.dirname(pytreeclass.__file__)),
lineno,
lineno + len(source) - 1,
)


# -- nbsphinx configuration --------------------------------------------------

nbsphinx_execute = "never"
Expand Down

0 comments on commit 6cf62b0

Please sign in to comment.