The following list has three items.
The first item is a normal paragraph with no lines breaks or other details.
- The second item has only a single line break inside, as it has only two interior lines that each start with
# Append this to the `conf.py` file at the root of your Sphinx project | |
# that is already using the `sphinx.ext.doctest` extension: | |
import doctest | |
import re | |
import sphinx.ext.doctest as ext_doctest | |
ADDRESS_RE = re.compile(r'\b0x[0-9a-f]{1,16}\b') | |
class BetterDocTestRunner(ext_doctest.SphinxDocTestRunner): |
# Inspired by the following sentence that I ran across this morning: | |
# | |
# "f_lineno is the current line number of the frame - writing to | |
# this from within a trace function jumps to the given line | |
# (only for the bottom-most frame). A debugger can implement a | |
# Jump command (aka Set Next Statement) by writing to f_lineno." | |
# | |
# https://docs.python.org/2/reference/datamodel.html | |
# | |
# There is an older implementation of a similar idea: |
# Generators leave it up to the caller whether | |
# to build a list, or set, or maybe just to | |
# loop and not build a data structure at all: | |
def get_children(self): | |
for c in self.children.itervalues(): | |
yield c | |
for c in self.children.itervalues(): | |
for c2 in c.get_children(): | |
yield c2 |
The following list has three items.
The first item is a normal paragraph with no lines breaks or other details.
"""Project a map of Middle-earth on modern Europe. | |
Builds an `overlay.kmz` file in the current directory which should be | |
opened with Google Earth. | |
""" | |
import os | |
import urllib2 | |
import zipfile | |
from math import cos, radians |
/* NOTE: this function requires the Google Maps "geometry" library which | |
Radarmatic does not currently load. It would need to load Maps with: | |
http://maps.google.com/maps/api/js?libraries=geometry&sensor=false */ | |
function sweepArc(context, center_x, center_y, radius, width, | |
start_angle, end_angle) { | |
/* Special case: if we are being asked to draw the big gray circle | |
around the current radar site, then draw a big gray circle. */ |
#!/bin/bash | |
# | |
# To use: cd to a directory you want to browse, and run this script. | |
# | |
# This lets you skip finding a free TCP port on your system and | |
# running SimpleHTTPServer on that port and pointing your browser there. | |
# Instead, we ask the SimpleHTTPServer to run at whichever free port the | |
# operating system would like to assign, we watch its output to see what | |
# port was in fact assigned, and then we open a new tab in the browser | |
# (in this case, Google Chrome) automatically. |