From d22799ca1d63e55d88fe0a3adf4c71904a591012 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 29 Jun 2010 21:02:51 -0700 Subject: Making pocco.py standalone, don't need the bin script --- bin/pocco | 10 ---------- pocco.py | 10 ++++++++-- 2 files changed, 8 insertions(+), 12 deletions(-) delete mode 100755 bin/pocco mode change 100644 => 100755 pocco.py diff --git a/bin/pocco b/bin/pocco deleted file mode 100755 index 884d538..0000000 --- a/bin/pocco +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env python - -import os -import sys - -lib = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..') -cmd = "python %s %s" % (os.path.join(lib, 'pocco.py'), - " ".join(sys.argv[1:])) - -print os.popen(cmd).read(), diff --git a/pocco.py b/pocco.py old mode 100644 new mode 100755 index 40e4691..667238e --- a/pocco.py +++ b/pocco.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + # **Pocco** is a Python port of [Docco](http://jashkenas.github.com/docco/ ): # the original quick-and-dirty, hundred-line-long, literate-programming-style # documentation generator. It produces HTML that displays your comments @@ -43,6 +45,8 @@ def generate_documentation(source): # def parse(source, code): lines = code.split("\n") + if lines[0].startswith("#!"): + lines.pop(0) sections = [] language = get_language(source) has_code = docs_text = code_text = "" @@ -168,10 +172,12 @@ def 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()) +pocco_template = template(open(path.join(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() +pocco_styles = open(path.join(path.dirname(__file__), + "resources/pocco.css")).read() # The start of each Pygments highlight block. highlight_start = "
"
-- 
cgit v1.2.3