INNER CODE UNIT · Python
fix_url
fralau/mkdocs-macros-plugin · mkdocs_macros/context.py:267
def fix_url(url):
"""
If url is relative, fix it so that it points to the docs directory.
This is necessary because relative links in markdown must be adapted
in html ('img/foo.png' => '../img/img.png').
"""
if is_relative(url):
r = "../" + url
else:
r = url
return r
# ---------------------------------
# Exports to the environment
# ---------------------------------
def define_env(env):