[tor-commits] [stem/master] Added style.css which overwrites basic.css

atagar at torproject.org atagar at torproject.org
Mon May 25 17:15:20 UTC 2015


commit 3d6fbd38c53f5afcdc8be1eae52c66bdb2d26bb6
Author: Sambuddha Basu <sambuddhabasu1 at gmail.com>
Date:   Mon May 25 06:49:01 2015 +0400

    Added style.css which overwrites basic.css
---
 docs/_static/example/hello_world.py                 |    9 +++++++++
 docs/_static/example/the_little_relay_that_could.py |    9 ---------
 docs/_static/style.css                              |    7 +++++++
 docs/_templates/layout.html                         |    2 ++
 docs/conf.py                                        |    2 +-
 docs/tutorials/the_little_relay_that_could.rst      |    6 ++----
 6 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/docs/_static/example/hello_world.py b/docs/_static/example/hello_world.py
new file mode 100644
index 0000000..88dd881
--- /dev/null
+++ b/docs/_static/example/hello_world.py
@@ -0,0 +1,9 @@
+from stem.control import Controller
+
+with Controller.from_port(port = 9051) as controller:
+  controller.authenticate()  # provide the password here if you set one
+
+  bytes_read = controller.get_info("traffic/read")
+  bytes_written = controller.get_info("traffic/written")
+
+  print "My Tor relay has read %s bytes and written %s." % (bytes_read, bytes_written)
diff --git a/docs/_static/example/the_little_relay_that_could.py b/docs/_static/example/the_little_relay_that_could.py
deleted file mode 100644
index 88dd881..0000000
--- a/docs/_static/example/the_little_relay_that_could.py
+++ /dev/null
@@ -1,9 +0,0 @@
-from stem.control import Controller
-
-with Controller.from_port(port = 9051) as controller:
-  controller.authenticate()  # provide the password here if you set one
-
-  bytes_read = controller.get_info("traffic/read")
-  bytes_written = controller.get_info("traffic/written")
-
-  print "My Tor relay has read %s bytes and written %s." % (bytes_read, bytes_written)
diff --git a/docs/_static/style.css b/docs/_static/style.css
new file mode 100644
index 0000000..098529d
--- /dev/null
+++ b/docs/_static/style.css
@@ -0,0 +1,7 @@
+div.literal-block-wrapper {
+    padding: 0;
+}
+
+span.caption-text {
+    float: right;
+}
diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html
index bc80512..e3c8d2c 100644
--- a/docs/_templates/layout.html
+++ b/docs/_templates/layout.html
@@ -9,6 +9,8 @@
 #}
 {% extends "basic/layout.html" %}
 
+{% set css_files = css_files + ['_static/style.css'] %}
+
 {# do not display relbars #}
 {% block relbar1 %}{% endblock %}
 {% block relbar2 %}{% endblock %}
diff --git a/docs/conf.py b/docs/conf.py
index 6535135..d888402 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -22,7 +22,7 @@ sys.path.append(os.path.abspath('.'))
 # -- General configuration -----------------------------------------------------
 
 # If your documentation needs a minimal Sphinx version, state it here.
-needs_sphinx = '1.1' # required for the sphinx-apidoc command
+needs_sphinx = '1.3' # required for the sphinx-apidoc command
 
 # Add any Sphinx extension module names here, as strings. They can be extensions
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
diff --git a/docs/tutorials/the_little_relay_that_could.rst b/docs/tutorials/the_little_relay_that_could.rst
index 8c16512..1c9067c 100644
--- a/docs/tutorials/the_little_relay_that_could.rst
+++ b/docs/tutorials/the_little_relay_that_could.rst
@@ -47,12 +47,10 @@ many bytes Tor has sent and received since it started. Note that there are a
 unfamiliar with the '**with**' keyword then see `here
 <../faq.html#what-is-that-with-keyword-i-keep-seeing-in-the-tutorials>`_...
 
-.. literalinclude:: /_static/example/the_little_relay_that_could.py
+.. literalinclude:: /_static/example/hello_world.py
+   :caption: `[Download] <../_static/example/hello_world.py>`_
    :language: python
 
-The above code snippet can be downloaded by clicking `here
-<../_static/example/the_little_relay_that_could.py>`_.
-
 ::
 
   % python example.py 





More information about the tor-commits mailing list