File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 3030# Add any Sphinx extension module names here, as strings. They can be
3131# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3232# ones.
33- extensions = ['sphinx.ext.autodoc' , 'sphinx.ext.viewcode' ]
33+ extensions = ['sphinx.ext.autodoc' , 'sphinx.ext.linkcode' ]
3434
3535# Add any paths that contain templates here, relative to this directory.
3636templates_path = ['_templates' ]
153153]
154154
155155
156-
156+ def linkcode_resolve (domain , info ):
157+ def find_line ():
158+ obj = sys .modules [info ['module' ]]
159+ for part in info ['fullname' ].split ('.' ):
160+ obj = getattr (obj , part )
161+ import inspect
162+ fn = inspect .getsourcefile (obj )
163+ source , lineno = inspect .findsource (obj )
164+ return lineno + 1
165+
166+ if domain != 'py' or not info ['module' ]:
167+ return None
168+ #tag = 'master' if 'dev' in release else ('v' + release)
169+ url = "https://github.com/draios/python-sdc-client/blob/teams-api/sdcclient/_client.py"
170+ try :
171+ return url + '#L%d' % find_line ()
172+ except Exception :
173+ return url
You can’t perform that action at this time.
0 commit comments