From d8f4a9b35f5af1297f7f3a3248dd476ea7634633 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sun, 1 May 2022 22:51:03 +0800 Subject: [PATCH] Fix the broken links to images on Windows --- sphinx_gmt/gmtplot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx_gmt/gmtplot.py b/sphinx_gmt/gmtplot.py index cf90f27..46e7565 100644 --- a/sphinx_gmt/gmtplot.py +++ b/sphinx_gmt/gmtplot.py @@ -426,7 +426,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)