Permalink
Browse files

modified example listings to display titles instead of filenames exce…

…pt where

multiple demos are present, then the filename is displayed.
  • Loading branch information...
1 parent 60e339a commit 8e574ef2ea66c35d4be3ac3303a31a8f8904b2cd @earney earney committed Jun 24, 2012
Showing with 13 additions and 5 deletions.
  1. +13 −5 examples/_examples/util.py
View
@@ -86,7 +86,7 @@ def sub(m):
<tr>{{example.{name}.demo1}}
<td rowspan="{{example.{name}.numdemos}}">
- {{example.{name}.title}}
+ {{example.{name}.desc}}
</td>
<td rowspan="{{example.{name}.numdemos}}">
@@ -97,7 +97,7 @@ def sub(m):
{{example.{name}._comment_start}} -->
''',
'demo': r'''
- <td><a href="{target}.html">{target}</a></td>
+ <td><a href="{target}.html">{title}</a></td>
''',
}
@@ -319,10 +319,18 @@ def install(package=None, **packages):
PACKAGE.update(package)
name = ENV['NAME_EXAMPLE']
- demos = [
- str(INDEX['demo']).format(name=name, target=target[:-3])
+ if len(TARGETS) == 1:
+ demos = [
+ str(INDEX['demo']).format(name=name, target=target[:-3],
+ title=PACKAGE['title'])
for target in TARGETS
- ]
+ ]
+ else:
+ demos = [
+ str(INDEX['demo']).format(name=name, target=target[:-3],
+ title=target[:-3])
+ for target in TARGETS
+ ]
example = {
'name': name,

0 comments on commit 8e574ef

Please sign in to comment.