Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0cc6af6

Browse files
committed
Merged revisions 7880 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_99_maint ........ r7880 | leejjoon | 2009-10-12 19:02:27 -0400 (Mon, 12 Oct 2009) | 1 line fix plot_directive.py that generated incorrect links for some cases ........ svn path=/trunk/matplotlib/; revision=7881
1 parent 1427eb9 commit 0cc6af6

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,10 @@ def _plot_directive(plot_path, basedir, function_name, plot_code, caption,
291291
# the temporary directory, and then sphinx moves the file to
292292
# build/html/_images for us later.
293293
rstdir, rstfile = os.path.split(state_machine.document.attributes['source'])
294-
reldir = rstdir[len(setup.confdir)+1:]
295-
relparts = [p for p in os.path.split(reldir) if p.strip()]
296-
nparts = len(relparts)
297294
outdir = os.path.join('plot_directive', basedir)
298-
linkdir = ('../' * nparts) + outdir
299-
295+
reldir = relpath(setup.confdir, rstdir)
296+
linkdir = os.path.join(reldir, outdir)
297+
300298
# tmpdir is where we build all the output files. This way the
301299
# plots won't have to be redone when generating latex after html.
302300

0 commit comments

Comments
 (0)