Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added labels to images in the gallery [sprint]#2161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mdboom merged 1 commit intomatplotlib:masterfromtbekolay:better-gallery
Jun 29, 2013
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletionsdoc/_static/mpl.css
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -566,3 +566,18 @@ table.docutils td {
width: 30em;
}

figure {
margin: 1em;
display: inline-block;
}

figure img {
margin-left: auto;
margin-right: auto;
}

figcaption {
text-align: center;
}


8 changes: 6 additions & 2 deletionsdoc/sphinxext/gen_gallery.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -41,7 +41,10 @@
</h4>"""

link_template = """\
<a href="{link}"><img src="{thumb}" border="0" alt="{basename}"/></a>
<figure>
<a href="{link}"><img src="{thumb}" border="0" alt="{basename}"/></a><br>
<figcaption><a href="{link}">{title}</a></figcaption>
</figure>
"""

toc_template = """\
Expand DownExpand Up@@ -122,7 +125,8 @@ def gen_gallery(app, doctree):
link = 'examples/%s/%s.html'%(subdir, basename)
rows.append(link_template.format(link=link,
thumb=thumbfile,
basename=basename))
basename=basename
title=basename))

if len(data) == 0:
warnings.warn("No thumbnails were found in %s" % subdir)
Expand Down
1 change: 1 addition & 0 deletionsdoc/sphinxext/gen_rst.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -121,6 +121,7 @@ def generate_example_rst(app):
rstfile = '%s.rst'%basename
outrstfile = os.path.join(rstdir, rstfile)

# XXX make into title
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm not sure I follow this comment. Would you mind expanding on this (in this github interface before adding a new commit)?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It would be nice to write titles for each of the example plots, likely in a file-level docstring. I was just making a note to myself that if each plot has a title, then it'd be good to change the following line to something likefhsubdirIndex.write(' %s <%s>\n'%(filetitle,rstfile)).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Ah, ok. Maybe you could update this comment along the lines of:

# XXX: We might consider putting extra metadata in the example files to include a title. If so, this line is where we would add this information.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Good idea.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

See#2174.

fhsubdirIndex.write(' %s <%s>\n'%(os.path.basename(basename),rstfile))

do_plot = (subdir in example_subdirs
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp