commit 7f463b14e32dff28b978264bb589ae62b7209b90 Author: Damian Johnson atagar@torproject.org Date: Thu Mar 27 09:35:49 2014 -0700
Improving syntax highlighting
Took a peek and Sphinx's docs for syntax highlighting, and using a bit of it...
* Using the lighttpd lexer for torrcs since it both fades comments and emphasizes torrc keywords. This is a hack, and doesn't work if torrc entries have a ':', in which case I'm using a bash lexer instead.
* Highlighting part related to event handling for its tutorial.
* Specifying python highlighting for a couple python snippet in the faq. --- docs/faq.rst | 4 ++-- docs/tutorials/mirror_mirror_on_the_wall.rst | 2 +- docs/tutorials/the_little_relay_that_could.rst | 2 +- docs/tutorials/tortoise_and_the_hare.rst | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/docs/faq.rst b/docs/faq.rst index 872e5b5..51aa527 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -372,14 +372,14 @@ Python's `with http://effbot.org/zone/python-with-statement.htm`_ keyword is shorthand for a try/finally block. With a :class:`~stem.control.Controller` the following...
-:: +.. code-block:: python
with Controller.from_port(port = 9051) as controller: # do my stuff
... is equivialnt to...
-:: +.. code-block:: python
controller = Controller.from_port(port = 9051)
diff --git a/docs/tutorials/mirror_mirror_on_the_wall.rst b/docs/tutorials/mirror_mirror_on_the_wall.rst index 918417b..a5ba5e6 100644 --- a/docs/tutorials/mirror_mirror_on_the_wall.rst +++ b/docs/tutorials/mirror_mirror_on_the_wall.rst @@ -93,7 +93,7 @@ application. And, of course, please consider `running Tor as a relay https://www.torproject.org/docs/tor-doc-relay.html.en`_ so you give back to the network!
-:: +.. code-block:: lighttpd
# Descriptors have a range of time during which they're valid. To get the # most recent descriptor information, regardless of if Tor needs it or not, diff --git a/docs/tutorials/the_little_relay_that_could.rst b/docs/tutorials/the_little_relay_that_could.rst index 0c1cb20..63e4493 100644 --- a/docs/tutorials/the_little_relay_that_could.rst +++ b/docs/tutorials/the_little_relay_that_could.rst @@ -12,7 +12,7 @@ protected by either a **password** or **authentication cookie**. Look at your `torrc https://www.torproject.org/docs/faq.html.en#torrc`_ for the following configuration options...
-:: +.. code-block:: bash
# This provides a port for our script to talk with. If you set this then be # sure to also set either CookieAuthentication *or* HashedControlPassword! diff --git a/docs/tutorials/tortoise_and_the_hare.rst b/docs/tutorials/tortoise_and_the_hare.rst index d313b62..50edba6 100644 --- a/docs/tutorials/tortoise_and_the_hare.rst +++ b/docs/tutorials/tortoise_and_the_hare.rst @@ -28,7 +28,8 @@ To do this it listens to **BW events** are events that Tor emits each second saying the number of bytes downloaded and uploaded.
-:: +.. code-block:: python + :emphasize-lines: 53-55,62-67
import curses import functools