version = release = tornado.version
-extensions = ["sphinx.ext.autodoc", "sphinx.ext.coverage", "sphinx.ext.viewcode"]
+extensions = [
+ "sphinx.ext.autodoc",
+ "sphinx.ext.coverage",
+ "sphinx.ext.extlinks",
+ "sphinx.ext.viewcode",
+ ]
primary_domain = 'py'
default_role = 'py:obj'
latex_documents = [
('index', 'tornado.tex', 'Tornado Documentation', 'Facebook', 'manual', False),
]
+
+# HACK: sphinx has limited support for substitutions with the |version|
+# variable, but there doesn't appear to be any way to use this in a link
+# target.
+# http://stackoverflow.com/questions/1227037/substitutions-inside-links-in-rest-sphinx
+# The extlink extension can be used to do link substitutions, but it requires a
+# portion of the url to be literally contained in the document. Therefore,
+# this link must be referenced as :current_tarball:`z`
+extlinks = {
+ 'current_tarball': (
+ 'https://github.com/downloads/facebook/tornado/tornado-%s.tar.g%%s' % version,
+ 'tornado-%s.tar.g' % version),
+ }
-Tornado Web Server
-==================
+.. title:: Tornado Web Server
-.. image:: tornado.png
+|Tornado Web Server|
+====================
+
+.. |Tornado Web Server| image:: tornado.png
:alt: Tornado Web Server
`Tornado <http://www.tornadoweb.org/>`_ is an open source version of
-----------
* `Documentation <documentation.html>`_
-* `Download version |version| <https://github.com/downloads/facebook/tornado/tornado-|version|.tar.gz>`_ (`release notes </documentation/releases.html>`_)
+* |Download current version|: :current_tarball:`z` (`release notes </documentation/releases.html>`_)
* `Source (github) <https://github.com/facebook/tornado>`_
* `Mailing list <http://groups.google.com/group/python-tornado>`_
* `Wiki <https://github.com/facebook/tornado/wiki/Links>`_
+.. |Download current version| replace:: Download version |version|
+
Hello, world
------------
installed in this way, so you may wish to download a copy of the
source tarball as well.
-**Manual installation:** Download `tornado-|version|.tar.gz <https://github.com/downloads/facebook/tornado/tornado-{{version}}.tar.gz>`_::
+**Manual installation:** Download :current_tarball:`z`:
+
+.. parsed-literal::
tar xvzf tornado-|version|.tar.gz
cd tornado-|version|