From d4834a68c62d4169067e6dc72a50da8497d81e3b Mon Sep 17 00:00:00 2001 From: "Paul J. Davis" Date: Fri, 19 Feb 2010 14:21:56 -0500 Subject: [PATCH] Update doc building. --- doc/buildweb.py | 17 +++++++++-------- doc/conf.py | 1 - doc/site/CNAME | 3 +++ 3 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 doc/site/CNAME diff --git a/doc/buildweb.py b/doc/buildweb.py index 1afa03f6..193a5924 100755 --- a/doc/buildweb.py +++ b/doc/buildweb.py @@ -36,11 +36,7 @@ class Site(object): self.process(files, curr_path, tgt_path) def process(self, files, curr_path, tgt_path): - files = [f for f in files if os.path.splitext(f)[1] in conf.EXTENSIONS] for f in files: - if os.path.splitext(f)[1] not in conf.EXTENSIONS: - continue - page = Page(self, f, curr_path, tgt_path) if not page.needed(): continue @@ -61,7 +57,12 @@ class Page(object): self.body = "" with open(self.source, 'Ur') as handle: - headers, body = handle.read().split("\n\n", 1) + raw = handle.read() + + try: + headers, body = raw.split("\n\n", 1) + except ValueError: + headers, body = "", raw try: for line in headers.splitlines(): @@ -104,11 +105,11 @@ class Page(object): def render(self): tmpl_name = self.headers.get('template', conf.DEFAULT_TEMPLATE) - + if not tmpl_name: + return self.body + kwargs = {"conf": conf, "stuff": self.body, "url": self.url()} kwargs.update(self.headers) - print self.body - return self.site.get_template(tmpl_name).render(kwargs) def convert_rst(self, body): diff --git a/doc/conf.py b/doc/conf.py index 30c15bf8..b974ed46 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -10,7 +10,6 @@ SITE_NAME = "Green Unicorn" SITE_URL = "http://www.gunicorn.org" SITE_DESCRIPTION = "A Python port of Ruby's Unicorn project." -EXTENSIONS = ['.rst'] DEFAULT_TEMPLATE = "default.html" CONTENT_TYPE = "textile" diff --git a/doc/site/CNAME b/doc/site/CNAME new file mode 100644 index 00000000..cefc9107 --- /dev/null +++ b/doc/site/CNAME @@ -0,0 +1,3 @@ +template: + +gunicorn.org