Commits

Mike Bayer committed 13bd9fd

- fix documentation versions in conf.py, other changes to site layout

Comments (0)

Files changed (5)

doc/build/builder/builders.py

 class MakoBridge(TemplateBridge):
     def init(self, builder, *args, **kw):
         self.layout = builder.config.html_context.get('mako_layout', 'html')
-        
+        builder.config.html_context['release_date'] = builder.config['release_date']
+        builder.config.html_context['versions'] = builder.config['versions']
         self.lookup = TemplateLookup(directories=builder.config.templates_path,
             format_exceptions=True, 
             imports=[
                 "from builder import util"
             ]
         )
-        
+
     def render(self, template, context):
         template = template.replace(".html", ".mako")
         context['prevtopic'] = context.pop('prev', None)
         # sphinx 1.0b2 doesn't seem to be providing _ for some reason...
         context.setdefault('_', lambda x:x)
         return self.lookup.get_template(template).render_unicode(**context)
-        
-    
+
+
     def render_string(self, template, context):
         context['prevtopic'] = context.pop('prev', None)
         context['nexttopic'] = context.pop('next', None)
                 "from builder import util"
             ]
         ).render_unicode(**context)
-        
+
 class StripDocTestFilter(Filter):
     def filter(self, lexer, stream):
         for ttype, value in stream:
         buf[-1] = (buf[-1][0], buf[-1][1].rstrip())
     for t, v in buf:
         yield t, v
-    
+
 class PopupSQLFormatter(HtmlFormatter):
     def _format_lines(self, tokensource):
         buf = []
                     yield 1, "<div class='popup_sql'>%s</div>" % re.sub(r'(?:[{stop}|\n]*)$', '', value)
             else:
                 buf.append((ttype, value))
-        
+
         for t, v in _strip_trailing_whitespace(HtmlFormatter._format_lines(self, iter(buf))):
             yield t, v
 
                     continue
             else:
                 yield ttype, value
-        
+
     def format(self, tokensource, outfile):
         LatexFormatter.format(self, self._filter_tokens(tokensource), outfile)
 
     app.add_lexer('pycon+sql', PyConWithSQLLexer())
     app.add_lexer('python+sql', PythonWithSQLLexer())
     app.connect('autodoc-skip-member', autodoc_skip_member)
+    app.add_config_value('release_date', "", True)
+    app.add_config_value('versions', "", True)
     PygmentsBridge.html_formatter = PopupSQLFormatter
     PygmentsBridge.latex_formatter = PopupLatexFormatter
-    
-    
+

doc/build/conf.py

 # built documents.
 #
 # The short X.Y version.
-version = sqlalchemy.__version__
+version = "0.5"
 # The full version, including alpha/beta/rc tags.
-release = sqlalchemy.__version__
+release = "0.5.8"
+
+release_date = "Jan 16, 2010"
+
+versions = [('0.7', '07'), ('0.6', '06'), ('0.5', '05')]
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
 
 # The name for this set of Sphinx documents.  If None, it defaults to
 # "<project> v<release> documentation".
-html_title = "%s %s Documentation" % (project, release)
+html_title = "%s %s Documentation" % (project, version)
 
 # A shorter title for the navigation bar.  Default is the same as html_title.
 #html_short_title = None

doc/build/templates/layout.mako

         </div>
 
         <div class="versionheader">
-            Version: <span class="versionnum">${release}</span> Last Updated: ${last_updated}
+            Release: <span class="versionnum">${release}</span> | Release Date: ${release_date}
+            % if not version.startswith(versions[0][0]):
+            <div class="versionwarning">
+                The current version of SQLAlchemy is ${versions[0][0]}.   <a href="/docs/">View current SQLAlchemy Documentation</a>
+            </div>
+            % endif
         </div>
         <div class="clearboth"></div>
 
                 <a href="${pathto('reference/index')}">API Reference</a>
                 |
                 <a href="${pathto('genindex')}">Index</a>
-            
+
                 % if sourcename:
                 <div class="sourcelink">(<a href="${pathto('_sources/' + sourcename, True)|h}">${_('view source')})</div>
                 % endif
             </div>
-            
+
             <div class="navbanner">
                 <a class="totoc" href="${pathto(master_doc)}">Table of Contents</a>
                 % if parents:
                 % if current_page_name != master_doc:
                 » ${self.show_title()} 
                 % endif
-                
+
                 ${prevnext()}
                 <h2>
                     ${self.show_title()} 
             % endif
             <div class="clearboth"></div>
         </div>
-        
+
         <div class="document">
             <div class="body">
                 ${next.body()}

doc/build/templates/site_base.mako

 </%text>
 
 <div style="text-align:right">
-<b>Quick Select:</b> <a href="/docs/06/">0.6</a> | <a href="/docs/05/">0.5</a><br/>
+<b>Quick Select:</b> ${" | ".join('<a href="/docs/%s/">%s</a>' % (link, vers) for vers, link in versions)}<br/>
 <b>PDF Download:</b> <a href="${pathto('sqlalchemy_' + release.replace('.', '_') + '.pdf', 1)}">download</a>
 </div>
 

lib/sqlalchemy/__init__.py

 
 __all__ = sorted(name for name, obj in locals().items()
                  if not (name.startswith('_') or inspect.ismodule(obj)))
-                 
+
 __version__ = '0.5.8'
 
 del inspect, sys
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.