Skip to content

Commit 4613c65

Browse files
Bump version 0.10.6
1 parent 2c751e7 commit 4613c65

File tree

1 file changed

+28
-23
lines changed

1 file changed

+28
-23
lines changed

src/ansys_sphinx_theme/__init__.py

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""This is the ansys-sphinx-theme module."""
2+
import logging
23
import pathlib
34
from typing import Any, Dict
45

@@ -9,7 +10,7 @@
910
from ansys_sphinx_theme.extension.linkcode import DOMAIN_KEYS, sphinx_linkcode_resolve
1011
from ansys_sphinx_theme.latex import generate_404 # noqa: F401
1112

12-
__version__ = "0.10.5"
13+
__version__ = "0.10.6"
1314

1415
# Declare the fundamental paths of the theme
1516
THIS_PATH = pathlib.Path(__file__).parent.resolve()
@@ -158,28 +159,32 @@ def fix_edit_link_page(link: str) -> str:
158159

159160
if "_autosummary" in pagename:
160161
for obj_node in list(doctree.findall(addnodes.desc)):
161-
domain = obj_node.get("domain")
162-
for signode in obj_node:
163-
if not isinstance(signode, addnodes.desc_signature):
164-
continue
165-
# Convert signode to a specified format
166-
info = {}
167-
for key in DOMAIN_KEYS.get(domain, []):
168-
value = signode.get(key)
169-
if not value:
170-
value = ""
171-
info[key] = value
172-
if not info:
173-
continue
174-
# This is an API example
175-
return sphinx_linkcode_resolve(
176-
domain=domain,
177-
info=info,
178-
library=f"{github_user}/{github_repo}",
179-
source_path=github_source,
180-
github_version=kind,
181-
edit=True,
182-
)
162+
try:
163+
domain = obj_node.get("domain")
164+
for signode in obj_node:
165+
if not isinstance(signode, addnodes.desc_signature):
166+
continue
167+
# Convert signode to a specified format
168+
info = {}
169+
for key in DOMAIN_KEYS.get(domain, []):
170+
value = signode.get(key)
171+
if not value:
172+
value = ""
173+
info[key] = value
174+
if not info:
175+
continue
176+
# This is an API example
177+
return sphinx_linkcode_resolve(
178+
domain=domain,
179+
info=info,
180+
library=f"{github_user}/{github_repo}",
181+
source_path=github_source,
182+
github_version=kind,
183+
edit=True,
184+
)
185+
except ValueError as e:
186+
logging.debug(f"An error occurred: {e}") # Log the exception as debug info
187+
return link
183188

184189
elif "autoapi" in pagename:
185190
for obj_node in list(doctree.findall(addnodes.desc)):

0 commit comments

Comments
 (0)