Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

broken links in the gallery #1024

Merged
merged 1 commit into from

3 participants

@montefra

the following links in the gallery
http://matplotlib.sourceforge.net/examples/pylab_examples/demo_tight_layout_00.html
http://matplotlib.sourceforge.net/examples/pylab_examples/demo_tight_layout_01.html
http://matplotlib.sourceforge.net/examples/axes_grid/demo_axes_divider_01.html
(and maybe others) do not work

error:
1. Server: matplotlib.sourceforge.net
2. URL path: /examples/pylab_examples/demo_tight_layout_00.html
3. Error notes: NONE
4. Error type: 404
5. Request method: GET
6. Request query string: NONE
7. Time: 2012-07-19 09:12:32 UTC (1342689152)

The corresponding links in the examples (e.g. http://matplotlib.sourceforge.net/examples/pylab_examples/demo_tight_layout.html) are fine

@WeatherGod
Collaborator

Confirmed in master as well. Not sure where these are coming from because the string "demo_tight_layout_00" doesn't exist in any of the version-controlled files.

@mdboom
Owner

The attached pull request resolves this issue. I am now going to upload a fixed version of the 1.1.x docs based on this change.

@WeatherGod
Collaborator

I think your fix would also solve a few other problems I have had as well (left over .pyc files get picked up sometimes), unless I am completely mis-understanding the regex.

@mdboom
Owner

I don't think it will address that, because it's only use with things before the extension. All it really addresses is that some of the examples produce multiple groups of figures, and those were not getting correctly linked back to the single .py that produced them.

Go ahead and file another bug if you're seeing something related to left over .pyc files.

@mdboom mdboom merged commit ff883a6 into from
@mdboom mdboom deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 3, 2012
  1. @mdboom

    Fix gallery links (#1024)

    mdboom authored
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 5 deletions.
  1. +2 −5 doc/sphinxext/gen_gallery.py
View
7 doc/sphinxext/gen_gallery.py
@@ -16,7 +16,7 @@
import os, glob, re, sys, warnings
import matplotlib.image as image
-multiimage = re.compile('(.*)_\d\d')
+multiimage = re.compile('(.*?)(_\d\d){1,2}')
def make_thumbnail(args):
image.thumbnail(args[0], args[1], 0.3)
@@ -68,11 +68,8 @@ def gen_gallery(app, doctree):
thumbnails[orig_path] = thumb_path
m = multiimage.match(basename)
- if m is None:
- pyfile = '%s.py'%basename
- else:
+ if m is not None:
basename = m.group(1)
- pyfile = '%s.py'%basename
data.append((subdir, basename,
os.path.join(rootdir, subdir, 'thumbnails', filename)))
Something went wrong with that request. Please try again.