diff --git a/sphinx_gmt/gmtplot.py b/sphinx_gmt/gmtplot.py index 5524b1c..800e8da 100644 --- a/sphinx_gmt/gmtplot.py +++ b/sphinx_gmt/gmtplot.py @@ -434,7 +434,7 @@ def run(self): builddir = Path(env.app.doctreedir).parent / "gmtplot_directive" # determine how to link to files in builddir from the RST file # use os.path.relpath rather than relative_to! - builddir_link = Path("/", os.path.relpath(str(builddir), env.app.srcdir)) + builddir_link = "/" / Path("/", os.path.relpath(str(builddir), env.app.srcdir)) # copy script to builddir builddir.mkdir(parents=True, exist_ok=True)