Skip to content

Commit 6db33d4

Browse files
committed
Merge pull request #477 from satra/fix/github
fix: trim http link for code
2 parents 4e7863d + a892a64 commit 6db33d4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/interfacedocgen.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def generate_api_doc(self, uri):
302302
ad += '\n.. _%s\n\n' % label
303303
ad += '\n.. index:: %s\n\n' % c
304304
ad += c + '\n' + self.rst_section_levels[2] * len(c) + '\n\n'
305-
ad += "Code: %s\n\n" % get_file_url(classinst)
305+
ad += "`Link to code <%s>`_\n\n" % get_file_url(classinst)
306306
ad += trim(classinst.help(returnhelp=True),
307307
self.rst_section_levels[3]) + '\n'
308308

@@ -313,7 +313,7 @@ def generate_api_doc(self, uri):
313313
label = ':func:`' + name + '`'
314314
ad += '\n.. _%s:\n\n' % (uri + '.' + name)
315315
ad += '\n'.join((label, self.rst_section_levels[2] * len(label)))
316-
ad += "\n\nCode: %s\n\n" % get_file_url(finst)
316+
ad += "\n\n`Link to code <%s>`_\n\n" % get_file_url(finst)
317317
helpstr = trim(finst.__doc__, self.rst_section_levels[3])
318318
ad += '\n\n' + helpstr + '\n\n'
319319

@@ -332,7 +332,7 @@ def generate_api_doc(self, uri):
332332
label = ':func:`' + name + '`'
333333
ad += '\n.. _%s:\n\n' % (uri + '.' + name)
334334
ad += '\n'.join((label, self.rst_section_levels[2] * len(label)))
335-
ad += "\n\nCode: %s\n\n" % get_file_url(finst)
335+
ad += "\n\n`Link to code <%s>`_\n\n" % get_file_url(finst)
336336
helpstr = trim(finst.__doc__, self.rst_section_levels[3])
337337
ad += '\n\n' + helpstr + '\n\n'
338338

0 commit comments

Comments
 (0)