From 80aff93d3f0040f5886e983a6ce781717f7703a4 Mon Sep 17 00:00:00 2001
From: Jeff Forcier <jeff@bitprophet.org>
Date: Tue, 1 Apr 2014 12:36:21 -0700
Subject: Fix broken tag-tree links in changelog

---
 sites/www/conf.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'sites/www/conf.py')

diff --git a/sites/www/conf.py b/sites/www/conf.py
index 1c6c9254..0c8af16c 100644
--- a/sites/www/conf.py
+++ b/sites/www/conf.py
@@ -14,7 +14,8 @@ rss_description = 'Paramiko project news'
 
 # Releases changelog extension
 extensions.append('releases')
-releases_release_uri = "https://github.com/paramiko/paramiko/tree/%s"
+# Paramiko 1.x tags start with 'v'. Meh.
+releases_release_uri = "https://github.com/paramiko/paramiko/tree/v%s"
 releases_issue_uri = "https://github.com/paramiko/paramiko/issues/%s"
 
 # Intersphinx for referencing API/usage docs
-- 
cgit v1.2.3


From 1103416d8386e7965bae0d51d596efc4f5a75670 Mon Sep 17 00:00:00 2001
From: Jeff Forcier <jeff@bitprophet.org>
Date: Sun, 6 Apr 2014 16:24:16 -0700
Subject: Put blog into a branch

---
 sites/www/blog.py              | 140 -----------------------------------------
 sites/www/blog.rst             |  16 -----
 sites/www/blog/first-post.rst  |   7 ---
 sites/www/blog/second-post.rst |   7 ---
 sites/www/conf.py              |   6 --
 sites/www/index.rst            |   9 +--
 6 files changed, 2 insertions(+), 183 deletions(-)
 delete mode 100644 sites/www/blog.py
 delete mode 100644 sites/www/blog.rst
 delete mode 100644 sites/www/blog/first-post.rst
 delete mode 100644 sites/www/blog/second-post.rst

(limited to 'sites/www/conf.py')

diff --git a/sites/www/blog.py b/sites/www/blog.py
deleted file mode 100644
index 3b129ebf..00000000
--- a/sites/www/blog.py
+++ /dev/null
@@ -1,140 +0,0 @@
-from collections import namedtuple
-from datetime import datetime
-import time
-import email.utils
-
-from sphinx.util.compat import Directive
-from docutils import nodes
-
-
-class BlogDateDirective(Directive):
-    """
-    Used to parse/attach date info to blog post documents.
-
-    No nodes generated, since none are needed.
-    """
-    has_content = True
-
-    def run(self):
-        # Tag parent document with parsed date value.
-        self.state.document.blog_date = datetime.strptime(
-            self.content[0], "%Y-%m-%d"
-        )
-        # Don't actually insert any nodes, we're already done.
-        return []
-
-class blog_post_list(nodes.General, nodes.Element):
-    pass
-
-class BlogPostListDirective(Directive):
-    """
-    Simply spits out a 'blog_post_list' temporary node for replacement.
-
-    Gets replaced at doctree-resolved time - only then will all blog post
-    documents be written out (& their date directives executed).
-    """
-    def run(self):
-        return [blog_post_list('')]
-
-
-Post = namedtuple('Post', 'name doc title date opener')
-
-def get_posts(app):
-    # Obtain blog posts
-    post_names = filter(lambda x: x.startswith('blog/'), app.env.found_docs)
-    posts = map(lambda x: (x, app.env.get_doctree(x)), post_names)
-    # Obtain common data used for list page & RSS
-    data = []
-    for post, doc in sorted(posts, key=lambda x: x[1].blog_date, reverse=True):
-        # Welp. No "nice" way to get post title. Thanks Sphinx.
-        title = doc[0][0][0]
-        # Date. This may or may not end up reflecting the required
-        # *input* format, but doing it here gives us flexibility.
-        date = doc.blog_date
-        # 1st paragraph as opener. TODO: allow a role or something marking
-        # where to actually pull from?
-        opener = doc.traverse(nodes.paragraph)[0]
-        data.append(Post(post, doc, title, date, opener))
-    return data
-
-def replace_blog_post_lists(app, doctree, fromdocname):
-    """
-    Replace blog_post_list nodes with ordered list-o-links to posts.
-    """
-    # Obtain blog posts
-    post_names = filter(lambda x: x.startswith('blog/'), app.env.found_docs)
-    posts = map(lambda x: (x, app.env.get_doctree(x)), post_names)
-    # Build "list" of links/etc
-    post_links = []
-    for post, doc, title, date, opener in get_posts(app):
-        # Link itself
-        uri = app.builder.get_relative_uri(fromdocname, post)
-        link = nodes.reference('', '', refdocname=post, refuri=uri)
-        # Title, bolded. TODO: use 'topic' or something maybe?
-        link.append(nodes.strong('', title))
-        date = date.strftime("%Y-%m-%d")
-        # Meh @ not having great docutils nodes which map to this.
-        html = '<div class="timestamp"><span>%s</span></div>' % date
-        timestamp = nodes.raw(text=html, format='html')
-        # NOTE: may group these within another element later if styling
-        # necessitates it
-        group = [timestamp, nodes.paragraph('', '', link), opener]
-        post_links.extend(group)
-
-    # Replace temp node(s) w/ expanded list-o-links
-    for node in doctree.traverse(blog_post_list):
-        node.replace_self(post_links)
-
-def rss_timestamp(timestamp):
-    # Use horribly inappropriate module for its magical daylight-savings-aware
-    # timezone madness. Props to Tinkerer for the idea.
-    return email.utils.formatdate(
-        time.mktime(timestamp.timetuple()),
-        localtime=True
-    )
-
-def generate_rss(app):
-    # Meh at having to run this subroutine like 3x per build. Not worth trying
-    # to be clever for now tho.
-    posts_ = get_posts(app)
-    # LOL URLs
-    root = app.config.rss_link
-    if not root.endswith('/'):
-        root += '/'
-    # Oh boy
-    posts = [
-        (
-            root + app.builder.get_target_uri(x.name),
-            x.title,
-            str(x.opener[0]), # Grab inner text element from paragraph
-            rss_timestamp(x.date),
-        )
-        for x in posts_
-    ]
-    location = 'blog/rss.xml'
-    context = {
-        'title': app.config.project,
-        'link': root,
-        'atom': root + location,
-        'description': app.config.rss_description,
-        # 'posts' is sorted by date already
-        'date': rss_timestamp(posts_[0].date),
-        'posts': posts,
-    }
-    yield (location, context, 'rss.xml')
-
-def setup(app):
-    # Link in RSS feed back to main website, e.g. 'http://paramiko.org'
-    app.add_config_value('rss_link', None, '')
-    # Ditto for RSS description field
-    app.add_config_value('rss_description', None, '')
-    # Interprets date metadata in blog post documents
-    app.add_directive('date', BlogDateDirective)
-    # Inserts blog post list node (in e.g. a listing page) for replacement
-    # below
-    app.add_node(blog_post_list)
-    app.add_directive('blog-posts', BlogPostListDirective)
-    # Performs abovementioned replacement
-    app.connect('doctree-resolved', replace_blog_post_lists)
-    # Generates RSS page from whole cloth at page generation step
-    app.connect('html-collect-pages', generate_rss)
diff --git a/sites/www/blog.rst b/sites/www/blog.rst
deleted file mode 100644
index af9651e4..00000000
--- a/sites/www/blog.rst
+++ /dev/null
@@ -1,16 +0,0 @@
-====
-Blog
-====
-
-.. blog-posts directive gets replaced with an ordered list of blog posts.
-
-.. blog-posts::
-
-
-.. The following toctree ensures blog posts get processed.
-
-.. toctree::
-    :hidden:
-    :glob:
-
-    blog/*
diff --git a/sites/www/blog/first-post.rst b/sites/www/blog/first-post.rst
deleted file mode 100644
index 7b075073..00000000
--- a/sites/www/blog/first-post.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-===========
-First post!
-===========
-
-A blog post.
-
-.. date:: 2013-12-04
diff --git a/sites/www/blog/second-post.rst b/sites/www/blog/second-post.rst
deleted file mode 100644
index c4463f33..00000000
--- a/sites/www/blog/second-post.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-===========
-Another one
-===========
-
-.. date:: 2013-12-05
-
-Indeed!
diff --git a/sites/www/conf.py b/sites/www/conf.py
index 0c8af16c..5047fa67 100644
--- a/sites/www/conf.py
+++ b/sites/www/conf.py
@@ -6,12 +6,6 @@ from os.path import abspath, join, dirname
 sys.path.append(abspath(join(dirname(__file__), '..')))
 from shared_conf import *
 
-# Local blog extension
-sys.path.append(abspath('.'))
-extensions.append('blog')
-rss_link = 'http://paramiko.org'
-rss_description = 'Paramiko project news'
-
 # Releases changelog extension
 extensions.append('releases')
 # Paramiko 1.x tags start with 'v'. Meh.
diff --git a/sites/www/index.rst b/sites/www/index.rst
index 03189cfa..77e5fcbb 100644
--- a/sites/www/index.rst
+++ b/sites/www/index.rst
@@ -11,6 +11,8 @@ contribution guidelines, development roadmap, news/blog, and so forth. Detailed
 usage and API documentation can be found at our code documentation site,
 `docs.paramiko.org <http://docs.paramiko.org>`_.
 
+Please see the sidebar to the left to bebin.
+
 .. toctree::
     :hidden:
 
@@ -20,13 +22,6 @@ usage and API documentation can be found at our code documentation site,
     contributing
     contact
 
-.. Hide blog in hidden toctree for now (to avoid warnings.)
-
-.. toctree::
-    :hidden:
-
-    blog
-
 
 .. rubric:: Footnotes
 
-- 
cgit v1.2.3


From be7c679942b9b3a1838cce692f87e1c3d45092cf Mon Sep 17 00:00:00 2001
From: Jeff Forcier <jeff@bitprophet.org>
Date: Mon, 14 Apr 2014 10:48:33 -0400
Subject: Errything uses intersphinx to Python

---
 sites/docs/conf.py   | 7 +------
 sites/shared_conf.py | 7 ++++++-
 sites/www/conf.py    | 4 +---
 3 files changed, 8 insertions(+), 10 deletions(-)

(limited to 'sites/www/conf.py')

diff --git a/sites/docs/conf.py b/sites/docs/conf.py
index f9355715..5674fed1 100644
--- a/sites/docs/conf.py
+++ b/sites/docs/conf.py
@@ -5,16 +5,11 @@ sys.path.append(os.path.abspath('../..'))
 from shared_conf import *
 
 # Enable autodoc, intersphinx
-extensions.extend(['sphinx.ext.autodoc', 'sphinx.ext.intersphinx'])
+extensions.extend(['sphinx.ext.autodoc'])
 
 # Autodoc settings
 autodoc_default_flags = ['members', 'special-members']
 
-# Intersphinx connection to stdlib
-intersphinx_mapping = {
-    'python': ('http://docs.python.org/2.6', None),
-}
-
 # Sister-site links to WWW
 html_theme_options['extra_nav_links'] = {
     "Main website": 'http://www.paramiko.org',
diff --git a/sites/shared_conf.py b/sites/shared_conf.py
index c265fc49..e0afe92e 100644
--- a/sites/shared_conf.py
+++ b/sites/shared_conf.py
@@ -5,7 +5,7 @@ import alabaster
 
 # Alabaster theme + mini-extension
 html_theme_path = [alabaster.get_path()]
-extensions = ['alabaster']
+extensions = ['alabaster', 'sphinx.ext.intersphinx']
 # Paths relative to invoking conf.py - not this shared file
 html_theme = 'alabaster'
 html_theme_options = {
@@ -24,6 +24,11 @@ html_sidebars = {
     ]
 }
 
+# Everything intersphinx's to Python
+intersphinx_mapping = {
+    'python': ('http://docs.python.org/2.6', None),
+}
+
 # Regular settings
 project = 'Paramiko'
 year = datetime.now().year
diff --git a/sites/www/conf.py b/sites/www/conf.py
index 5047fa67..bdb5929a 100644
--- a/sites/www/conf.py
+++ b/sites/www/conf.py
@@ -20,9 +20,7 @@ target = join(dirname(__file__), '..', 'docs', '_build')
 if os.environ.get('READTHEDOCS') == 'True':
     # TODO: switch to docs.paramiko.org post go-live of sphinx API docs
     target = 'http://docs.paramiko.org/en/latest/'
-intersphinx_mapping = {
-    'docs': (target, None),
-}
+intersphinx_mapping['docs'] = (target, None)
 
 # Sister-site links to API docs
 html_theme_options['extra_nav_links'] = {
-- 
cgit v1.2.3


From d8a71fcdf0b57837632ccfa806386443fdb6dcc2 Mon Sep 17 00:00:00 2001
From: Jeff Forcier <jeff@bitprophet.org>
Date: Mon, 18 Aug 2014 18:36:59 -0700
Subject: Sphinx conf cleanup

---
 sites/www/conf.py | 3 ---
 1 file changed, 3 deletions(-)

(limited to 'sites/www/conf.py')

diff --git a/sites/www/conf.py b/sites/www/conf.py
index bdb5929a..0b0fb85c 100644
--- a/sites/www/conf.py
+++ b/sites/www/conf.py
@@ -12,13 +12,10 @@ extensions.append('releases')
 releases_release_uri = "https://github.com/paramiko/paramiko/tree/v%s"
 releases_issue_uri = "https://github.com/paramiko/paramiko/issues/%s"
 
-# Intersphinx for referencing API/usage docs
-extensions.append('sphinx.ext.intersphinx')
 # Default is 'local' building, but reference the public docs site when building
 # under RTD.
 target = join(dirname(__file__), '..', 'docs', '_build')
 if os.environ.get('READTHEDOCS') == 'True':
-    # TODO: switch to docs.paramiko.org post go-live of sphinx API docs
     target = 'http://docs.paramiko.org/en/latest/'
 intersphinx_mapping['docs'] = (target, None)
 
-- 
cgit v1.2.3