From: Nick Fitzgerald Date: Wed, 30 Jun 2010 03:29:43 +0000 (-0700) Subject: Updating index again X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=7d03c279f98194370d34997c6a11998db7331fbe;p=pycco.git Updating index again --- diff --git a/index.html b/index.html index 0ed7d1f..59c56bb 100644 --- a/index.html +++ b/index.html @@ -131,7 +131,7 @@ wherever our markers occur.

output = output.replace(highlight_start, "").replace(highlight_end, "") fragments = re.split(language["divider_html"], output) for i, section in enumerate(sections): - section["code_html"] = highlight_start + fragments[i] + highlight_end + section["code_html"] = highlight_start + shift(fragments, "") + highlight_end section["docs_html"] = markdown(section["docs_text"]) section["num"] = i @@ -245,7 +245,7 @@ sections.

on this to recover the original sections.

-
    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*')
@@ -286,6 +286,21 @@ is 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.

@@ -295,50 +310,50 @@ is 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.