Skip to content

Commit ad18157

Browse files
committed
0.4.8 Update
case-insensitive cross-references
1 parent 180dffb commit ad18157

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = 'sphinxfortran_ng'
3-
version = '0.4.7'
3+
version = '0.4.8'
44
authors = [{name = "Lorenzo Crippa", email="[email protected]"}]
55
description = "An improved version of the sphinx-fortran python module"
66
readme = "README.md"

src/sphinxfortran_ng/fortran_domain.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,9 +1073,11 @@ def process_link(self, env, refnode, has_explicit_title, title, target):
10731073
title = title.lstrip('.') # only has a meaning for the target
10741074
target = target.lstrip('~') # only has a meaning for the title
10751075
if target is not None:
1076+
target = target.lower()
10761077
found_target = False
10771078
targetshort = target.split(f_sep)[-1]
10781079
for ikey in env.domaindata['f']['objects'].keys(): #check if target is in this module
1080+
ikey = ikey.lower()
10791081
if targetshort ==ikey.split(f_sep)[-1]:
10801082
found_target = True
10811083
break
@@ -1093,7 +1095,8 @@ def process_link(self, env, refnode, has_explicit_title, title, target):
10931095
ftypeslist = all_invs[which_invs[iinv]].keys()
10941096
for jkey in ftypeslist:
10951097
for ikey in all_invs[which_invs[iinv]][jkey].keys():
1096-
if targetshort == ikey.split(f_sep)[-1] and ikey.startswith('f' + f_sep) and (targetlist==[] or (ikey not in targetlist[-1] and targetlist[-1] not in ikey)):
1098+
#if targetshort == ikey.split(f_sep)[-1] and ikey.startswith('f' + f_sep) and (targetlist==[] or (ikey not in targetlist[-1] and targetlist[-1] not in ikey)):
1099+
if targetshort.lower() == ikey.split(f_sep)[-1].lower() and ikey.lower().startswith('f' + f_sep.lower()) and (targetlist == [] or (ikey not in targetlist[-1] and targetlist[-1] not in ikey)):
10971100
targetlist.append(ikey)
10981101
if len(targetlist)>1:
10991102
print("Warning, duplicate labels for "+title+": ",targetlist)

0 commit comments

Comments
 (0)