Skip to content

Commit 05603fe

Browse files
authored
fix github links (#4679)
1 parent 58b9ccc commit 05603fe

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ydb/tests/olap/docs/generator/__main__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ def _get_github_link(obj, text: str, header_level: int) -> str:
114114
file = inspect.getsourcefile(obj)
115115
if file is None:
116116
return text
117+
contrib_prefix = 'contrib/'
118+
if file.startswith(f'{contrib_prefix}ydb'):
119+
file = file[len(contrib_prefix):]
117120
_, line = inspect.findsource(obj)
118121
size = 27 - 3 * header_level
119122
return f'[![Code on Github](../_assets/github_icon.png "Github" ={size}x) {text}](https://github.com/ydb-platform/ydb/blob/main/{file}?#L{line + 1})'

0 commit comments

Comments
 (0)