Skip to content

Commit

Permalink
Fix linkcode again (#27)
Browse files Browse the repository at this point in the history
* fix project name linkcode

* fix project name linkcode

* fix linkcode again
  • Loading branch information
adamgayoso authored Oct 10, 2022
1 parent 91009b3 commit df2a789
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@

# -- Project information -----------------------------------------------------

info = metadata("scib-metrics")
project = info["Name"]
package_name = "scib-metrics"
info = metadata(package_name)
project = info["Name"] # scib_metrics
author = info["Author"]
copyright = f"{datetime.now():%Y}, {author}."
version = info["Version"]
Expand All @@ -39,7 +40,7 @@
html_context = {
"display_github": True, # Integrate GitHub
"github_user": "yoseflab", # Username
"github_repo": project, # Repo name
"github_repo": package_name, # Repo name
"github_version": "main", # Version
"conf_py_path": "/docs/", # Path in the checkout to the docs root
}
Expand Down Expand Up @@ -134,9 +135,7 @@ def git(*args):
git_ref = "main"

# https://github.com/DisnakeDev/disnake/blob/7853da70b13fcd2978c39c0b7efa59b34d298186/docs/conf.py#L192
# If package name differs from the project name, set it here
package_name = project
github_repo = "https://github.com/" + html_context["github_user"] + "/" + project
github_repo = "https://github.com/" + html_context["github_user"] + "/" + package_name
_project_module_path = os.path.dirname(importlib.util.find_spec(package_name).origin) # type: ignore


Expand Down Expand Up @@ -173,7 +172,7 @@ def linkcode_resolve(domain, info):
html_title = "scib-metrics"

html_theme_options = {
"repository_url": "https://github.com/yoseflab/scib-metrics",
"repository_url": github_repo,
"use_repository_button": True,
}

Expand Down

0 comments on commit df2a789

Please sign in to comment.