File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -122,20 +122,20 @@ def build_finished(app, env):
122
122
if app .builder .format != "html" :
123
123
return
124
124
125
- module_path = Path (__file__ )
126
- outdir_path = Path (app .outdir )
125
+ module_dir = Path (__file__ ). parent
126
+ outdir = Path (app .outdir )
127
127
128
128
# Copy stylesheet
129
- src = module_path / "css"
130
- dst = outdir_path / "_static"
129
+ src = module_dir / "css"
130
+ dst = outdir / "_static"
131
131
copy_asset (src , dst )
132
132
133
133
thebe_config = app .config .jupyter_sphinx_thebelab_config
134
134
if not thebe_config :
135
135
return
136
136
137
137
# Copy all thebelab related assets
138
- src = module_path / "thebelab"
138
+ src = module_dir / "thebelab"
139
139
copy_asset (src , dst )
140
140
141
141
Original file line number Diff line number Diff line change @@ -81,7 +81,8 @@ def sphinx_abs_dir(env, *paths):
81
81
# Can't get relative path between drives on Windows
82
82
return out_path .as_posix ()
83
83
84
- return "/" + out_path .relative_to (env .app .srcdir ).as_posix ()
84
+ # Path().relative_to() doesn't work when not a direct subpath
85
+ return "/" + os .path .relpath (out_path , env .app .srcdir )
85
86
86
87
87
88
def output_directory (env ):
You can’t perform that action at this time.
0 commit comments