mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Update doc building.
This commit is contained in:
parent
b7cce49f65
commit
d4834a68c6
@ -36,11 +36,7 @@ class Site(object):
|
|||||||
self.process(files, curr_path, tgt_path)
|
self.process(files, curr_path, tgt_path)
|
||||||
|
|
||||||
def process(self, 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:
|
for f in files:
|
||||||
if os.path.splitext(f)[1] not in conf.EXTENSIONS:
|
|
||||||
continue
|
|
||||||
|
|
||||||
page = Page(self, f, curr_path, tgt_path)
|
page = Page(self, f, curr_path, tgt_path)
|
||||||
if not page.needed():
|
if not page.needed():
|
||||||
continue
|
continue
|
||||||
@ -61,7 +57,12 @@ class Page(object):
|
|||||||
self.body = ""
|
self.body = ""
|
||||||
|
|
||||||
with open(self.source, 'Ur') as handle:
|
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:
|
try:
|
||||||
for line in headers.splitlines():
|
for line in headers.splitlines():
|
||||||
@ -104,11 +105,11 @@ class Page(object):
|
|||||||
|
|
||||||
def render(self):
|
def render(self):
|
||||||
tmpl_name = self.headers.get('template', conf.DEFAULT_TEMPLATE)
|
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 = {"conf": conf, "stuff": self.body, "url": self.url()}
|
||||||
kwargs.update(self.headers)
|
kwargs.update(self.headers)
|
||||||
print self.body
|
|
||||||
|
|
||||||
return self.site.get_template(tmpl_name).render(kwargs)
|
return self.site.get_template(tmpl_name).render(kwargs)
|
||||||
|
|
||||||
def convert_rst(self, body):
|
def convert_rst(self, body):
|
||||||
|
|||||||
@ -10,7 +10,6 @@ SITE_NAME = "Green Unicorn"
|
|||||||
SITE_URL = "http://www.gunicorn.org"
|
SITE_URL = "http://www.gunicorn.org"
|
||||||
SITE_DESCRIPTION = "A Python port of Ruby's Unicorn project."
|
SITE_DESCRIPTION = "A Python port of Ruby's Unicorn project."
|
||||||
|
|
||||||
EXTENSIONS = ['.rst']
|
|
||||||
DEFAULT_TEMPLATE = "default.html"
|
DEFAULT_TEMPLATE = "default.html"
|
||||||
CONTENT_TYPE = "textile"
|
CONTENT_TYPE = "textile"
|
||||||
|
|
||||||
|
|||||||
3
doc/site/CNAME
Normal file
3
doc/site/CNAME
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
template:
|
||||||
|
|
||||||
|
gunicorn.org
|
||||||
Loading…
x
Reference in New Issue
Block a user