Commit 0f318d14 authored by Jakub Ružička's avatar Jakub Ružička
Browse files

Merge branch 'fix-doc-file-link' into 'master'

docs: fix file_link on Read the Docs

See merge request !41
parents b9db09ed 947754fa
Pipeline #80139 passed with stages
in 2 minutes and 4 seconds
......@@ -28,8 +28,14 @@ def define_env(env):
@env.filter
def file_link(path):
fn = Path(path)
try:
# full path can be passed (i.e. on Read the Docs)
fn = Path(path).relative_to(BASE_PATH)
except ValueError:
pass
return "[{fn}]({url}{fn})".format(
fn=path.relative_to(BASE_PATH),
fn=fn,
url=BASE_CODE_URL)
@env.filter
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment