Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Labels
Milestone
Description
When using thedirhtml
builder in sphinx with the.. plot::
directive, the generated links are relative to the source file tree not the output, i.e. the source file name become a directory containing index.html, however the relative path generated is based on the location of the source file
dest_dir_link=os.path.join(relpath(setup.confdir,rst_dir), |
I fixed this locally using the the following hack, however I don't think this is the appropriate solution there should be some way to make the directive use the output path not the input path, which would remove the need for a hack solution. Hence I'm posting this as a issue rather than a patch.
ifsetup.app.builder.name=='dirhtml':subdir=os.path.basename(os.path.splitext(rst_file)[0])dest_dir_link=os.path.join(relpath(setup.confdir,os.path.join(rst_dir,subdir)),source_rel_dir).replace(os.path.sep,'/')else:dest_dir_link=os.path.join(relpath(setup.confdir,rst_dir),source_rel_dir).replace(os.path.sep,'/')