From 7d03c279f98194370d34997c6a11998db7331fbe Mon Sep 17 00:00:00 2001
From: Nick Fitzgerald
l["divider_html"] = re.compile(r'\n*<span class="c">' + l["symbol"] + 'DIVIDER</span>\n*')
l["divider_html"] = re.compile(r'\n*<span class="c[1]?">' + l["symbol"] + 'DIVIDER</span>\n*')
lib/example.py, the HTML will be at docs/example.html
#
+ Shift items off the front of the list until it is empty, then return
+default.
+ def shift(list, default):
+ try:
+ return list.pop(0)
+ except IndexError:
+ return default
Ensure that the destination directory exists.
lib/example.py, the HTML will be at docs/example.htmldef template(source):
return lambda context: pystache.render(source, context)
Create the template that we will use to generate the Pocco HTML page.
pocco_template = template(open(path.dirname(__file__) + "/resources/pocco.html").read())
The CSS styles we"d like to apply to the documentation.
pocco_styles = open(path.dirname(__file__) + "/resources/pocco.css").read()
The start of each Pygments highlight block.
highlight_start = "<div class=\"highlight\"><pre>"
The end of each Pygments highlight block.
highlight_end = "</pre></div>"
Run the script. For each source file passed in as an argument, generate the documentation.
-- 2.43.0