From db07a9a938e3437b01d06f561cdf83c5b5003cf5 Mon Sep 17 00:00:00 2001 From: Pablo Hoffman Date: Thu, 23 Dec 2010 13:03:40 -0200 Subject: [PATCH] Added notice to documentation, pointing dev to stable versions and viceversa --- docs/_static/scrapydoc.css | 13 +++++++++++++ docs/_templates/page.html | 25 +++++++++++++++++++++++++ docs/conf.py | 9 ++++----- 3 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 docs/_templates/page.html diff --git a/docs/_static/scrapydoc.css b/docs/_static/scrapydoc.css index 3e58a5e70..9ec34edca 100644 --- a/docs/_static/scrapydoc.css +++ b/docs/_static/scrapydoc.css @@ -638,6 +638,19 @@ img.logo { border: 0; } +.docversion { + padding-top: 5px; + padding-bottom: 5px; +} + +.devdoc { + color: red; +} + +.stabledoc { + color: #777; +} + /* :::: PRINT :::: */ @media print { div.document, diff --git a/docs/_templates/page.html b/docs/_templates/page.html new file mode 100644 index 000000000..7556ca191 --- /dev/null +++ b/docs/_templates/page.html @@ -0,0 +1,25 @@ +{% extends "layout.html" %} +{% block body %} +
+ +
+ {% if version == "0.11" %} +

+ This document is for Scrapy's development version, which can be + significantly different from previous releases. Get old docs here: + 0.10, + 0.9. + 0.8. + 0.7. +

+ {% else %} +

+ This document describes Scrapy {{ version }}. For development docs, + go here. +

+ {% endif %} +
+ +
+ {{ body }} +{% endblock %} diff --git a/docs/conf.py b/docs/conf.py index 1ce11cde2..90823c0c2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -42,7 +42,7 @@ master_doc = 'index' # General information about the project. project = u'Scrapy' -copyright = u'2008-2010, Insophia' +copyright = u'2008-2011, Insophia' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -51,12 +51,11 @@ copyright = u'2008-2010, Insophia' # The short X.Y version. try: import scrapy - version = scrapy.__version__ + version = '.'.join(map(str, scrapy.version_info[:2])) + release = scrapy.__version__ except ImportError: version = '' - -# The full version, including alpha/beta/rc tags. -release = version + release = '' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.