Commits

Doug Hellmann  committed 95c5802

fix sidebar templates for package build

  • Participants
  • Parent commits e513990

Comments (0)

Files changed (6)

File sphinx/conf.py

     'python_version':sysconfig.get_config_vars()['py_version'],
     }
 
-html_sidebars = {
-    'index':['sidebar_subscribe.html',
+if os.environ['TEMPLATES'] == 'pkg':
+    html_sidebars = {
+        'index':['sidebar_subscribe.html',
+                 'sidebar_book.html',
+                 ],
+        'about':['sidebar_subscribe.html',
+                 'sidebar_toc.html',
+                 'sidebar_book.html',
+                 ],
+        '*':['sidebar_toc.html',
+             'sidebar_navigation.html',
+             'sidebar_book.html',
+             ],
+        '**':['sidebar_toc.html',
+              'sidebar_navigation.html',
+              'sidebar_examples.html',
+              'sidebar_book.html',
+              ],
+        }
+else:
+    html_sidebars = {
+        'index':['sidebar_subscribe.html',
+                 'sidebar_book.html',
+                 'sidebar_ads.html',
+                 ],
+        'about':['sidebar_subscribe.html',
+                 'sidebar_toc.html',
+                 'sidebar_book.html',
+                 'sidebar_ads.html',
+                 ],
+        '*':['sidebar_toc.html',
+             'sidebar_navigation.html',
              'sidebar_book.html',
              'sidebar_ads.html',
              ],
-    'about':['sidebar_subscribe.html',
-             'sidebar_toc.html',
-             'sidebar_book.html',
-             'sidebar_ads.html',
-             ],
-    '*':['sidebar_toc.html',
-         'sidebar_navigation.html',
-         'sidebar_book.html',
-         'sidebar_ads.html',
-         ],
-    '**':['sidebar_toc.html',
-          'sidebar_navigation.html',
-          'sidebar_examples.html',
-          'sidebar_book.html',
-          'sidebar_ads.html',
-          ],
-    }
+        '**':['sidebar_toc.html',
+              'sidebar_navigation.html',
+              'sidebar_examples.html',
+              'sidebar_book.html',
+              'sidebar_ads.html',
+              ],
+        }
 
 # The TEMPLATES variable is set by the Makefile before sphinx-build is called.
 templates_path = ['../sphinx/templates/%s' % os.environ['TEMPLATES'],

File sphinx/templates/pkg/sidebar_book.html

+<p><iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&bc1=000000&IS2=1&bg1=DDDDDD&fc1=000000&lc1=CC6714&t=hellflynet-20&o=1&p=8&l=as1&m=amazon&f=ifr&md=10FE9736YVPPT7A0FBG2&asins=0321767349" style="width:120px;height:240px;margin:0 1em 0 1em;" scrolling="no" frameborder="0"></iframe></p>

File sphinx/templates/pkg/sidebar_examples.html

+<h3>Examples</h3>
+
+<p>The output from all the example programs from PyMOTW has been
+generated with Python {{python_version}}, unless otherwise noted. Some
+of the features described here may not be available in earlier
+versions of Python.</p>

File sphinx/templates/pkg/sidebar_navigation.html

+    <h3>Navigation</h3>
+      <p>
+    <a href="{{ pathto("contents") }}"><strong>Table of Contents</strong></a><br/>
+    {% if next or prev %}
+        {%- if prev %}
+          <a href="{{ prev.link|e }}" title="previous chapter"><strong>Previous:</strong> {{ prev.title }}</a><br/>
+        {%- endif %}
+
+        {%- if next %}
+          <a href="{{ next.link|e }}" title="next chapter"><strong>Next:</strong> {{ next.title }}</a><br/>
+        {%- endif %}
+      </p>
+    {% endif %}
+
+    {%- if show_source and has_source and sourcename %}
+      <h3>{{ _('This Page') }}</h3>
+      <p>
+      <a href="{{ pathto('_sources/' + sourcename, true)|e }}"
+               rel="nofollow">{{ _('Show Source') }}</a>
+      </p>
+    {%- endif %}

File sphinx/templates/pkg/sidebar_subscribe.html

+<h3>Subscribe</h3>
+
+<p>
+<a href="http://feeds.feedburner.com/PyMOTW" title="Subscribe to my feed" rel="alternate" type="application/rss+xml"><img src="http://www.feedburner.com/fb/images/pub/feed-icon32x32.png" alt="" style="border:0"/></a> <a href="http://feeds.feedburner.com/PyMOTW" title="Subscribe to my feed" rel="alternate" type="application/rss+xml">Subscribe in a reader</a></p>
+
+<p><a target="_blank" href="http://www.feedburner.com/fb/a/emailverifySubmit?feedId=806224&amp;loc=en_US" title="Receive email notification of posts"><img src="_static/images/mail-icon-32x32.png" alt="" style="border:0" /></a> <a target="_blank" href="http://www.feedburner.com/fb/a/emailverifySubmit?feedId=806224&amp;loc=en_US" title="Receive email notification of posts">Subscribe by Email</a></p>

File sphinx/templates/pkg/sidebar_toc.html

+{%- block sidebartoc %}
+{%- if display_toc %}
+  <h3>Page Contents</h3>
+  {{ toc }}
+{%- endif %}
+{%- endblock %}