Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
packaging
apkg
Commits
947754fa
Commit
947754fa
authored
Apr 23, 2021
by
Jakub Ružička
Browse files
docs: fix file_link on Read the Docs
In RtD mkdocs build absolute path is supplied - make it relative when that happens.
parent
b9db09ed
Pipeline
#80138
passed with stage
in 2 minutes and 19 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
docs/__init__.py
View file @
947754fa
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment