File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 33
33
autosectionlabel_prefix_document = True
34
34
35
35
linkcode_commit = os .environ .get ("READTHEDOCS_VERSION" , "next" )
36
+ if linkcode_commit == "stable" :
37
+ import aiopenapi3 .version
38
+
39
+ linkcode_commit = f"v{ aiopenapi3 .version .__version__ } "
40
+ elif linkcode_commit == "latest" :
41
+ linkcode_commit = "master"
42
+ elif linkcode_commit == "next" :
43
+ pass
36
44
linkcode_url = f"https://github.com/commonism/aiopenapi3/blob/{ linkcode_commit } "
37
45
38
46
@@ -65,7 +73,7 @@ def linkcode_resolve(domain, info):
65
73
# Path("…/aiopenapi3/__init__.py").parent.parent == "…"
66
74
libdir = Path (mod .__file__ ).parent .parent
67
75
file = Path (file ).relative_to (libdir )
68
- start , end = lines [1 ] - 1 , lines [1 ] - 1 + len (lines [0 ]) - 1
76
+ start , end = lines [1 ], lines [1 ] + len (lines [0 ]) - 1
69
77
70
78
return f"{ linkcode_url } /{ file } #L{ start } -L{ end } "
71
79
You can’t perform that action at this time.
0 commit comments