Fixes broken source links in API docs (#9636)

* Fixes broken source links in API docs

* Removes illegal blank line
pull/9646/head
David Byrne 2017-10-02 07:10:01 +01:00 committed by Paulus Schoutsen
parent fc4a21e491
commit 52671842d5
1 changed files with 5 additions and 1 deletions

View File

@ -117,7 +117,11 @@ def linkcode_resolve(domain, info):
linespec = "#L%d" % (lineno + 1) linespec = "#L%d" % (lineno + 1)
else: else:
linespec = "" linespec = ""
fn = relpath(fn, start='../') index = fn.find("/homeassistant/")
if index == -1:
index = 0
fn = fn[index:]
return '{}/blob/{}/{}{}'.format(GITHUB_URL, code_branch, fn, linespec) return '{}/blob/{}/{}{}'.format(GITHUB_URL, code_branch, fn, linespec)